hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74b3ddeea03a54d12ac085e31a490850eb04981 | 455 | py | Python | data/scripts/templates/object/mobile/shared_dressed_mauler_apprentice.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_dressed_mauler_apprentice.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_dressed_mauler_apprentice.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_mauler_apprentice.iff"
result.attribute_template_id = ... | 26.764706 | 71 | 0.736264 |
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_mauler_apprentice.iff"
result.attribute_template_id = 9
result.stfName("npc_name","aqualish_base_female")
return result | true | true |
f74b3deac866aec8a5fc39d7264161954d998927 | 3,026 | py | Python | validator/forms/validation_run.py | s-scherrer/qa4sm | 99fa62d5e42e5a2b81c5bad1553c8137fe4259e7 | [
"MIT"
] | null | null | null | validator/forms/validation_run.py | s-scherrer/qa4sm | 99fa62d5e42e5a2b81c5bad1553c8137fe4259e7 | [
"MIT"
] | null | null | null | validator/forms/validation_run.py | s-scherrer/qa4sm | 99fa62d5e42e5a2b81c5bad1553c8137fe4259e7 | [
"MIT"
] | null | null | null | from datetime import datetime
from validator.validation.globals import START_TIME, END_TIME
from django.contrib.auth import get_user_model
User = get_user_model()
import django.forms as forms
from validator.forms import YearChoiceField
from validator.models import ValidationRun
## See https://simpleisbetterthancomp... | 37.825 | 136 | 0.643093 | from datetime import datetime
from validator.validation.globals import START_TIME, END_TIME
from django.contrib.auth import get_user_model
User = get_user_model()
import django.forms as forms
from validator.forms import YearChoiceField
from validator.models import ValidationRun
class ValidationRunForm(forms.ModelFo... | true | true |
f74b40320018d4ded5d88094e2e8b7be20429bce | 686 | py | Python | tuticfruti_blog/posts/managers.py | tuticfruti/tuticfruti_blog | dd2526cc23d0e571b588b434a4d9e25dd7d82230 | [
"BSD-3-Clause"
] | null | null | null | tuticfruti_blog/posts/managers.py | tuticfruti/tuticfruti_blog | dd2526cc23d0e571b588b434a4d9e25dd7d82230 | [
"BSD-3-Clause"
] | 22 | 2015-09-28T07:45:35.000Z | 2015-10-15T22:07:05.000Z | tuticfruti_blog/posts/managers.py | tuticfruti/tuticfruti_blog | dd2526cc23d0e571b588b434a4d9e25dd7d82230 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.db import models
class PostManager(models.Manager):
def all_published(self):
return self.filter(status_id=self.model.STATUS_PUBLISHED)
def all_draft(self):
return self.filter(status_id=self.model.STATUS_DRAFT)
class CommentManager(models.Manager):
def... | 25.407407 | 65 | 0.720117 | from django.db import models
class PostManager(models.Manager):
def all_published(self):
return self.filter(status_id=self.model.STATUS_PUBLISHED)
def all_draft(self):
return self.filter(status_id=self.model.STATUS_DRAFT)
class CommentManager(models.Manager):
def all_published(self):
... | true | true |
f74b405d31776994ed1cc9ff1485376fcbd203e4 | 76 | py | Python | ABC078/ABC078d.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC078/ABC078d.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | ABC078/ABC078d.py | VolgaKurvar/AtCoder | 21acb489f1594bbb1cdc64fbf8421d876b5b476d | [
"Unlicense"
] | null | null | null | #ABC078d
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| 15.2 | 28 | 0.789474 | import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
| true | true |
f74b408edaaecb489ff513dd28862157336e51bb | 763 | py | Python | kattis/Integer Division.py | jaredliw/python-question-bank | 9c8c246623d8d171f875700b57772df0afcbdcdf | [
"MIT"
] | 1 | 2021-04-08T07:49:15.000Z | 2021-04-08T07:49:15.000Z | kattis/Integer Division.py | jaredliw/leetcode-solutions | 9c8c246623d8d171f875700b57772df0afcbdcdf | [
"MIT"
] | null | null | null | kattis/Integer Division.py | jaredliw/leetcode-solutions | 9c8c246623d8d171f875700b57772df0afcbdcdf | [
"MIT"
] | 1 | 2022-01-23T02:12:24.000Z | 2022-01-23T02:12:24.000Z | # CPU: 0.13 s
from collections import Counter
# Double for loop does not work: TLE
n_nums, divisor = map(int, input().split())
nums = Counter(map(lambda x: int(x) // divisor, input().split()))
print(sum(map(lambda x: x * (x - 1) // 2, nums.values())))
# CPU: 0.13 s
# n_nums, divisor = map(int, input().split())
# nums... | 28.259259 | 65 | 0.650066 | from collections import Counter
n_nums, divisor = map(int, input().split())
nums = Counter(map(lambda x: int(x) // divisor, input().split()))
print(sum(map(lambda x: x * (x - 1) // 2, nums.values())))
| true | true |
f74b41b4e8f6a88ea2c20193284cf43ea502ef1a | 383 | py | Python | djinstagram/instaapp/migrations/0004_remove_photo_path.py | rocity/dj-instagram | 78f97b3fbd465032c1e031048ced5db39d23bdee | [
"Apache-2.0"
] | 5 | 2016-08-05T03:29:09.000Z | 2017-10-12T10:11:59.000Z | djinstagram/instaapp/migrations/0004_remove_photo_path.py | rocity/dj-instagram | 78f97b3fbd465032c1e031048ced5db39d23bdee | [
"Apache-2.0"
] | null | null | null | djinstagram/instaapp/migrations/0004_remove_photo_path.py | rocity/dj-instagram | 78f97b3fbd465032c1e031048ced5db39d23bdee | [
"Apache-2.0"
] | 4 | 2018-10-02T14:00:49.000Z | 2021-06-22T15:34:47.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-16 01:39
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('instaapp', '0003_photo_image'),
]
operations = [
migrations.RemoveField(
... | 19.15 | 47 | 0.603133 | from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('instaapp', '0003_photo_image'),
]
operations = [
migrations.RemoveField(
model_name='photo',
name='path',
),
]
| true | true |
f74b4350a083a52c86c48a0e4e8e9262c97c2069 | 1,839 | py | Python | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/6_features/numtrees_45/rule_37.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/6_features/numtrees_45/rule_37.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | duke-cs671-fall21-coupon-recommendation/outputs/rules/RF/6_features/numtrees_45/rule_37.py | apcarrik/kaggle | 6e2d4db58017323e7ba5510bcc2598e01a4ee7bf | [
"MIT"
] | null | null | null | def findDecision(obj): #obj[0]: Passanger, obj[1]: Coupon, obj[2]: Education, obj[3]: Occupation, obj[4]: Restaurant20to50, obj[5]: Distance
# {"feature": "Occupation", "instances": 23, "metric_value": 0.9656, "depth": 1}
if obj[3]<=21:
# {"feature": "Passanger", "instances": 21, "metric_value": 0.9183, "depth": 2}... | 34.698113 | 140 | 0.561175 | def findDecision(obj): if obj[3]<=21:
if obj[0]>0:
if obj[1]<=3:
if obj[2]<=2:
if obj[4]>0.0:
return 'True'
elif obj[4]<=0.0:
return 'False'
else: return 'False'
elif obj[2]>2:
if obj[4]<=2.0:
return 'False'
elif obj[4]>2.0:
if obj... | true | true |
f74b43c82421c144e884cae63146167746c73284 | 20,436 | py | Python | pyleecan/Classes/LamSlotWind.py | carbon-drive/pyleecan | e89d4fe97f23f6182c19127d2c6a2133614e169d | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/LamSlotWind.py | carbon-drive/pyleecan | e89d4fe97f23f6182c19127d2c6a2133614e169d | [
"Apache-2.0"
] | null | null | null | pyleecan/Classes/LamSlotWind.py | carbon-drive/pyleecan | e89d4fe97f23f6182c19127d2c6a2133614e169d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# File generated according to Generator/ClassesRef/Machine/LamSlotWind.csv
# WARNING! All changes made in this file will be lost!
"""Method code available at https://github.com/Eomys/pyleecan/tree/master/pyleecan/Methods/Machine/LamSlotWind
"""
from os import linesep
from sys import getsizeof
f... | 33.283388 | 110 | 0.605451 |
from os import linesep
from sys import getsizeof
from logging import getLogger
from ._check import check_var, raise_
from ..Functions.get_logger import get_logger
from ..Functions.save import save
from ..Functions.copy import copy
from ..Functions.load import load_init_dict
from ..Functions.Load.import_class import im... | true | true |
f74b452ee0b5bb5bd72a67c43b8debc74e4a7304 | 1,102 | py | Python | bfield/python/ex03_plot_loopxyz_magnitude.py | bbw7561135/PlasmaEDU | f0183b3bbe5e3e047699133be6fa5403f7f921ee | [
"MIT"
] | 6 | 2020-08-04T21:51:28.000Z | 2021-12-09T22:16:43.000Z | bfield/python/ex03_plot_loopxyz_magnitude.py | bbw7561135/PlasmaEDU | f0183b3bbe5e3e047699133be6fa5403f7f921ee | [
"MIT"
] | 3 | 2020-02-19T16:12:05.000Z | 2020-09-21T20:44:16.000Z | bfield/python/ex03_plot_loopxyz_magnitude.py | lcpp-org/PlasmaEDU | aba2a00c04413bdf26c74f9e5c515644a517b728 | [
"MIT"
] | 5 | 2020-02-19T16:09:02.000Z | 2022-01-31T19:56:00.000Z | ################################################################################
#
# BFIELD
#
# Simple example of plot of the magnitude of the magnetic field
# produced by a current loop, using its Cartesian components
#
#
################################################################################
import num... | 25.627907 | 80 | 0.565336 |
import numpy as np
import bfield
import matplotlib.pyplot as plt
Ra = 0.05
I0 = 100.
Nturns = 1
Center = np.array([0,0,0])
Angles = np.array([90,0,0]) * np.pi/180.0
X = np.linspace(-0.1, 0.1, 50 )
Y = np.linspace(-0.1, 0.1, 50 )
Bnorm = np.zeros((X.size,Y.size))
for i in range(0,X.size):
for j in range(0,Y.size):... | true | true |
f74b46de49169d0c22c7fc1e13680652eb203b52 | 38 | py | Python | steiner/__main__.py | OvechkinDanil/SteinerProblem | 0454bc4c449df18acb80897394a7485dca6ff638 | [
"MIT"
] | null | null | null | steiner/__main__.py | OvechkinDanil/SteinerProblem | 0454bc4c449df18acb80897394a7485dca6ff638 | [
"MIT"
] | null | null | null | steiner/__main__.py | OvechkinDanil/SteinerProblem | 0454bc4c449df18acb80897394a7485dca6ff638 | [
"MIT"
] | 1 | 2021-09-27T18:52:28.000Z | 2021-09-27T18:52:28.000Z | from steiner.main import main
main()
| 9.5 | 29 | 0.763158 | from steiner.main import main
main()
| true | true |
f74b46f9ae8a168fb3ec9806ff7c67f4278480fa | 36,051 | py | Python | python_modules/dagster/dagster_tests/core_tests/resource_tests/test_resource_definition.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 1 | 2021-01-31T19:16:29.000Z | 2021-01-31T19:16:29.000Z | python_modules/dagster/dagster_tests/core_tests/resource_tests/test_resource_definition.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/resource_tests/test_resource_definition.py | rpatil524/dagster | 6f918d94cbd543ab752ab484a65e3a40fd441716 | [
"Apache-2.0"
] | 1 | 2019-09-11T03:02:27.000Z | 2019-09-11T03:02:27.000Z | from contextlib import contextmanager
from unittest import mock
import pytest
from dagster import (
DagsterEventType,
DagsterInvariantViolationError,
DagsterResourceFunctionError,
Enum,
EnumValue,
Field,
Int,
ModeDefinition,
PipelineDefinition,
ResourceDefinition,
String,
... | 27.881671 | 101 | 0.645946 | from contextlib import contextmanager
from unittest import mock
import pytest
from dagster import (
DagsterEventType,
DagsterInvariantViolationError,
DagsterResourceFunctionError,
Enum,
EnumValue,
Field,
Int,
ModeDefinition,
PipelineDefinition,
ResourceDefinition,
String,
... | true | true |
f74b46fa501390a2f8f993e5e4e24869fa388cdc | 3,345 | py | Python | compiler_gym/wrappers/core.py | ibrumar/CompilerGym | ecd1b62a3f072082227910a2a2487d6e06a52d4e | [
"MIT"
] | null | null | null | compiler_gym/wrappers/core.py | ibrumar/CompilerGym | ecd1b62a3f072082227910a2a2487d6e06a52d4e | [
"MIT"
] | null | null | null | compiler_gym/wrappers/core.py | ibrumar/CompilerGym | ecd1b62a3f072082227910a2a2487d6e06a52d4e | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import Iterable, Union
import gym
from compiler_gym.envs import CompilerEnv
from compiler_gym.util.gym_type_hints import Observat... | 34.132653 | 80 | 0.675934 | from typing import Iterable, Union
import gym
from compiler_gym.envs import CompilerEnv
from compiler_gym.util.gym_type_hints import ObservationType, StepType
class CompilerEnvWrapper(gym.Wrapper):
def __init__(self, env: CompilerEnv):
super().__init__(env)
def reset(self, *args, **kwargs) -> Obse... | true | true |
f74b4972078d61a2956f15b07e7c4fb84b010aa4 | 496 | py | Python | env/lib/python3.8/site-packages/plotly/validators/layout/ternary/domain/_row.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/ternary/domain/_row.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-08-09T02:30:14.000Z | 2022-03-12T00:50:14.000Z | env/lib/python3.8/site-packages/plotly/validators/layout/ternary/domain/_row.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11 | 2020-07-12T16:18:07.000Z | 2022-02-05T16:48:35.000Z | import _plotly_utils.basevalidators
class RowValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="row", parent_name="layout.ternary.domain", **kwargs
):
super(RowValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | 31 | 78 | 0.614919 | import _plotly_utils.basevalidators
class RowValidator(_plotly_utils.basevalidators.IntegerValidator):
def __init__(
self, plotly_name="row", parent_name="layout.ternary.domain", **kwargs
):
super(RowValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent... | true | true |
f74b4a4e658f877e37ad26656950bc25a7bc0eee | 1,893 | py | Python | tests/components/hardkernel/test_config_flow.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/hardkernel/test_config_flow.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | tests/components/hardkernel/test_config_flow.py | liangleslie/core | cc807b4d597daaaadc92df4a93c6e30da4f570c6 | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Test the Hardkernel config flow."""
from unittest.mock import patch
from homeassistant.components.hardkernel.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import RESULT_TYPE_ABORT, RESULT_TYPE_CREATE_ENTRY
from tests.common import MockConfigEntry, MockModule, m... | 32.084746 | 85 | 0.696249 | from unittest.mock import patch
from homeassistant.components.hardkernel.const import DOMAIN
from homeassistant.core import HomeAssistant
from homeassistant.data_entry_flow import RESULT_TYPE_ABORT, RESULT_TYPE_CREATE_ENTRY
from tests.common import MockConfigEntry, MockModule, mock_integration
async def test_config... | true | true |
f74b4a8f31867a40c849036624f250ee474b40ba | 2,674 | py | Python | angr/analyses/callee_cleanup_finder.py | delia0204/angr | 0fd71a73d36b8a6e441634d21bad947c7e5a7def | [
"BSD-2-Clause"
] | 1 | 2021-05-25T21:23:38.000Z | 2021-05-25T21:23:38.000Z | angr/analyses/callee_cleanup_finder.py | sch3m4/angr | 654350ff4bafdb7df25f2992ba1de00b15282fc0 | [
"BSD-2-Clause"
] | null | null | null | angr/analyses/callee_cleanup_finder.py | sch3m4/angr | 654350ff4bafdb7df25f2992ba1de00b15282fc0 | [
"BSD-2-Clause"
] | 1 | 2022-02-03T20:06:20.000Z | 2022-02-03T20:06:20.000Z | from . import Analysis, register_analysis
from .. import SIM_PROCEDURES
import logging
l = logging.getLogger('angr.analyses.callee_cleanup_finder')
class CalleeCleanupFinder(Analysis):
def __init__(self, starts=None, hook_all=False):
self.results = {}
if starts is None:
starts = [imp.... | 41.138462 | 149 | 0.545999 | from . import Analysis, register_analysis
from .. import SIM_PROCEDURES
import logging
l = logging.getLogger('angr.analyses.callee_cleanup_finder')
class CalleeCleanupFinder(Analysis):
def __init__(self, starts=None, hook_all=False):
self.results = {}
if starts is None:
starts = [imp.... | true | true |
f74b4b42fe8a050f6fb9558fa10c5d83c9a3f9d0 | 1,270 | py | Python | nhc2_coco/coco_generic.py | nielsvissers/nhc2-coco | 4afd0ef568a72c9e6a4ad68e56467aaf62044c53 | [
"MIT"
] | 7 | 2022-03-15T19:03:58.000Z | 2022-03-31T11:45:11.000Z | nhc2_coco/coco_generic.py | nielsvissers/nhc2-coco | 4afd0ef568a72c9e6a4ad68e56467aaf62044c53 | [
"MIT"
] | 11 | 2022-03-09T21:02:19.000Z | 2022-03-31T19:02:44.000Z | nhc2_coco/coco_generic.py | nielsvissers/nhc2-coco | 4afd0ef568a72c9e6a4ad68e56467aaf62044c53 | [
"MIT"
] | 12 | 2020-01-15T19:49:55.000Z | 2022-03-04T17:20:27.000Z | from .coco_entity import CoCoEntity
from .const import KEY_BASICSTATE, VALUE_TRIGGERED, VALUE_ON, KEY_STATUS
from .helpers import extract_property_value_from_device
class CoCoGeneric(CoCoEntity):
@property
def is_on(self):
return self._is_on
def __init__(self, dev, callback_container, client, pr... | 36.285714 | 102 | 0.720472 | from .coco_entity import CoCoEntity
from .const import KEY_BASICSTATE, VALUE_TRIGGERED, VALUE_ON, KEY_STATUS
from .helpers import extract_property_value_from_device
class CoCoGeneric(CoCoEntity):
@property
def is_on(self):
return self._is_on
def __init__(self, dev, callback_container, client, pr... | true | true |
f74b4c54ee98389baae67aa0c3a2f826f349675c | 962 | py | Python | pyhaystack/info.py | lixs74/pyhaystack | e5ce87f25fd42fdc3bbeab98a1ea1c673e88cdcb | [
"Apache-2.0"
] | null | null | null | pyhaystack/info.py | lixs74/pyhaystack | e5ce87f25fd42fdc3bbeab98a1ea1c673e88cdcb | [
"Apache-2.0"
] | null | null | null | pyhaystack/info.py | lixs74/pyhaystack | e5ce87f25fd42fdc3bbeab98a1ea1c673e88cdcb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
File : pyhaystackTest.py (2.x)
This module allow a connection to a haystack server
Feautures provided allow user to fetch data from the server and eventually, to post to it.
See http://www.project-haystack.org for more details
Project Haystack is an open source initiative to streamline wor... | 53.444444 | 435 | 0.776507 |
__author__ = 'Christian Tremblay, Stuart J. Longland, @sudo-Whateverman, Igor'
__author_email__ = 'christian.tremblay@servisys.com'
__version__ = '0.91.1'
__license__ = 'LGPL'
__copyright__ = "Christian Tremblay / SERVISYS inc. | Stuart J. Longland / VRT | 2016"
| true | true |
f74b4c83f122e8a5ba183b39f35b47e7cdf98eb1 | 2,510 | py | Python | models.py | djoker07/facial_keipoint_detection | 112564b12330b0b18be8665a70c92c09e3434ce8 | [
"MIT"
] | null | null | null | models.py | djoker07/facial_keipoint_detection | 112564b12330b0b18be8665a70c92c09e3434ce8 | [
"MIT"
] | null | null | null | models.py | djoker07/facial_keipoint_detection | 112564b12330b0b18be8665a70c92c09e3434ce8 | [
"MIT"
] | null | null | null | ## TODO: define the convolutional neural network architecture
import torch
import torch.nn as nn
import torch.nn.functional as F
# can use the below import should you choose to initialize the weights of your Net
import torch.nn.init as I
class Net(nn.Module):
def __init__(self):
super(Net, self).__init_... | 38.615385 | 153 | 0.607171 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as I
class Net(nn.Module):
def __init__(self):
super(Net, self).__init__()
# As an example, you've been given a convolutional layer, which you may (but don't ... | true | true |
f74b4d7e94f11965a11549a3b9e38a14f25bac6a | 5,410 | py | Python | pandas/tests/extension/decimal/test_decimal.py | BranYang/pandas | 1033e8b1195d4071253889ada60523832285354c | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-05-12T21:50:27.000Z | 2021-05-12T21:50:27.000Z | pandas/tests/extension/decimal/test_decimal.py | BranYang/pandas | 1033e8b1195d4071253889ada60523832285354c | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/extension/decimal/test_decimal.py | BranYang/pandas | 1033e8b1195d4071253889ada60523832285354c | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | import decimal
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
from pandas.tests.extension import base
from .array import DecimalDtype, DecimalArray, make_data
@pytest.fixture
def dtype():
return DecimalDtype()
@pytest.fixture
def data():
return DecimalArray(make_dat... | 27.886598 | 77 | 0.648799 | import decimal
import numpy as np
import pandas as pd
import pandas.util.testing as tm
import pytest
from pandas.tests.extension import base
from .array import DecimalDtype, DecimalArray, make_data
@pytest.fixture
def dtype():
return DecimalDtype()
@pytest.fixture
def data():
return DecimalArray(make_dat... | true | true |
f74b4d993a0924840e87803def68d4558bb809a0 | 2,666 | py | Python | Pokemon Identifier/poketype.py | sethuiyer/mlhub | 6be271c0070a0c0bb90dd92aceb344e7415bb1db | [
"MIT"
] | 22 | 2016-12-28T16:14:18.000Z | 2019-09-22T16:39:29.000Z | Pokemon Identifier/poketype.py | sethuiyer/mlhub | 6be271c0070a0c0bb90dd92aceb344e7415bb1db | [
"MIT"
] | 6 | 2020-03-24T17:48:55.000Z | 2022-03-12T00:04:58.000Z | Pokemon Identifier/poketype.py | sethuiyer/mlhub | 6be271c0070a0c0bb90dd92aceb344e7415bb1db | [
"MIT"
] | 17 | 2017-01-17T09:45:14.000Z | 2020-04-21T07:19:39.000Z | import pickle
import pandas as pd
from sklearn.utils import resample
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.svm import LinearSVC
import os
class PokemonTypeIdentifier():
"""
This class identifies the pokemon type of a user given pokemon name.
"""
def __init__(sel... | 49.37037 | 109 | 0.60165 | import pickle
import pandas as pd
from sklearn.utils import resample
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.svm import LinearSVC
import os
class PokemonTypeIdentifier():
def __init__(self):
self.isModelLoaded = False
self.isFileFound = False
if os.path.is... | true | true |
f74b4db77c2ef2a022961f6e6cd92cdf8f029a14 | 8,433 | py | Python | gperf/gperf.py | sakti/gperf | d9076e77886fb0a8a8e259e205a226648159af3a | [
"BSD-3-Clause"
] | null | null | null | gperf/gperf.py | sakti/gperf | d9076e77886fb0a8a8e259e205a226648159af3a | [
"BSD-3-Clause"
] | null | null | null | gperf/gperf.py | sakti/gperf | d9076e77886fb0a8a8e259e205a226648159af3a | [
"BSD-3-Clause"
] | 3 | 2015-02-26T13:16:37.000Z | 2022-01-25T19:16:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import optparse
import csv
import re
import datetime as dt
from random import choice
from collections import defaultdict
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
font... | 33.464286 | 87 | 0.500415 |
import os
import sys
import optparse
import csv
import re
import datetime as dt
from random import choice
from collections import defaultdict
import matplotlib as mpl
mpl.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.font_manager import FontProperties
fontP = FontProperties()
fontP.set_size('small')
... | false | true |
f74b4ddae8c36146a7b30742d4689621c726648e | 5,383 | py | Python | qa/rpc-tests/p2p-instantsend.py | AmirAbrams/dash | 2ae1ce4800a22c717b67aea97680bbe1eeffa07b | [
"MIT"
] | 4 | 2020-01-05T01:39:26.000Z | 2020-12-04T18:48:25.000Z | qa/rpc-tests/p2p-instantsend.py | AmirAbrams/dash | 2ae1ce4800a22c717b67aea97680bbe1eeffa07b | [
"MIT"
] | null | null | null | qa/rpc-tests/p2p-instantsend.py | AmirAbrams/dash | 2ae1ce4800a22c717b67aea97680bbe1eeffa07b | [
"MIT"
] | 3 | 2019-12-23T18:48:57.000Z | 2021-06-19T17:46:42.000Z | #!/usr/bin/env python3
# Copyright (c) 2018 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_framework import DashTestFramework
from test_frame... | 42.054688 | 124 | 0.67193 |
from test_framework.mininode import *
from test_framework.test_framework import DashTestFramework
from test_framework.util import *
from time import *
class InstantSendTest(DashTestFramework):
def __init__(self):
super().__init__(9, 5, fast_dip3_enforcement=True)
self.isolated_idx = 1
... | true | true |
f74b4f85fc9df182e481bf5e430c56cd3e353fd2 | 301 | py | Python | tests/wd/configs/default/__init__.py | wutiantong/sea | 2f7906c2167efba8b8b04b89009bf04d3922f090 | [
"MIT"
] | 156 | 2017-07-11T03:07:31.000Z | 2022-03-03T18:05:36.000Z | tests/wd/configs/default/__init__.py | wutiantong/sea | 2f7906c2167efba8b8b04b89009bf04d3922f090 | [
"MIT"
] | 203 | 2017-07-10T06:08:21.000Z | 2022-03-23T21:59:04.000Z | tests/wd/configs/default/__init__.py | wutiantong/sea | 2f7906c2167efba8b8b04b89009bf04d3922f090 | [
"MIT"
] | 60 | 2017-07-27T12:25:04.000Z | 2022-01-18T09:04:43.000Z | from .peewee import *
from .async_task import *
CACHE_BACKEND = "Redis"
MIDDLEWARES = [
"sea.middleware.ServiceLogMiddleware",
"sea.middleware.RpcErrorMiddleware",
]
REDIS_HOST = "localhost"
REDIS_PORT = 6379
REDIS_DB = 0
TIMEZONE = "Asia/Shanghai"
GRPC_GRACE = 0
PROMETHEUS_SCRAPE = True
| 16.722222 | 42 | 0.740864 | from .peewee import *
from .async_task import *
CACHE_BACKEND = "Redis"
MIDDLEWARES = [
"sea.middleware.ServiceLogMiddleware",
"sea.middleware.RpcErrorMiddleware",
]
REDIS_HOST = "localhost"
REDIS_PORT = 6379
REDIS_DB = 0
TIMEZONE = "Asia/Shanghai"
GRPC_GRACE = 0
PROMETHEUS_SCRAPE = True
| true | true |
f74b4fd56f4339525a4bd6ec2b28ad0660abcbf4 | 7,713 | py | Python | tests/system/action/motion/test_create_amendment.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | tests/system/action/motion/test_create_amendment.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | 19 | 2021-11-22T16:25:54.000Z | 2021-11-25T13:38:13.000Z | tests/system/action/motion/test_create_amendment.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | from tests.system.action.base import BaseActionTestCase
class MotionCreateAmendmentActionTest(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
# create parent motion and workflow
self.set_models(
{
"motion_workflow/12": {
"name":... | 33.534783 | 88 | 0.477376 | from tests.system.action.base import BaseActionTestCase
class MotionCreateAmendmentActionTest(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
self.set_models(
{
"motion_workflow/12": {
"name": "name_workflow1",
... | true | true |
f74b5045c18666d7ad68c9f7f15baa7d3d6ee3b2 | 8,662 | py | Python | Scripts/simulation/fishing/aquarium_object.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/fishing/aquarium_object.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/fishing/aquarium_object.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\fishing\aquarium_object.py
# Compiled at: 2018-02-28 22:55:27
# Size of source mod 2**32: 6387 bytes... | 48.391061 | 451 | 0.529785 | import collections
from sims4 import hash_util
import broadcasters.environment_score, objects.game_object, sims4.tuning.tunable, sims4.tuning.tunable_base, vfx
class Aquarium(objects.game_object.GameObject):
VFX_SLOT_NAME = '_FX_fish_'
INSTANCE_TUNABLES = {'fish_vfx_prefix': sims4.tuning.tunable.Tunable(descri... | false | true |
f74b50485cadc66ecf3141f9eda753dcad623336 | 6,693 | py | Python | pyalgotrade/binance/broker.py | metacash-one/pyalgotrade | f9760285b014896e2ef2422adf7268240f6bdee5 | [
"Apache-2.0"
] | 1 | 2018-10-15T04:35:42.000Z | 2018-10-15T04:35:42.000Z | pyalgotrade/binance/broker.py | metacash-one/pyalgotrade | f9760285b014896e2ef2422adf7268240f6bdee5 | [
"Apache-2.0"
] | null | null | null | pyalgotrade/binance/broker.py | metacash-one/pyalgotrade | f9760285b014896e2ef2422adf7268240f6bdee5 | [
"Apache-2.0"
] | null | null | null | # PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 38.912791 | 117 | 0.682504 |
import threading
from datetime import datetime
from .. import bar, broker
from ..bar import TradeBar
from ..broker import backtesting, MarketOrder, FloatTraits
from ..orderbook import OrderBook, Bid, Ask
from . import livebroker
LiveBroker = livebroker.LiveBroker
class BinanceFees(backtesting.Commission):
d... | true | true |
f74b50d1eea18c487d1184d32e76e91eeb1b60c1 | 863 | py | Python | Assignment3/Written/naive_naive_beta.py | CKPalk/MachineLearning | aeb19d72f2d1d56c6e940f57883b13189408aa4c | [
"MIT"
] | null | null | null | Assignment3/Written/naive_naive_beta.py | CKPalk/MachineLearning | aeb19d72f2d1d56c6e940f57883b13189408aa4c | [
"MIT"
] | null | null | null | Assignment3/Written/naive_naive_beta.py | CKPalk/MachineLearning | aeb19d72f2d1d56c6e940f57883b13189408aa4c | [
"MIT"
] | null | null | null | def main():
maximum = 20
for w in range( maximum ):
for x in range( maximum ):
for y in range( maximum ):
for z in range( maximum ):
#print ( w, x, y, z )
positive_Y = float( float(y+z+1)/float(w+x+y+z+2) * ( float(z+1)/float(y+z+2) ) )
negative_Y = float( float(w+x+1)/float(w+x+y+z+2... | 37.521739 | 89 | 0.550406 | def main():
maximum = 20
for w in range( maximum ):
for x in range( maximum ):
for y in range( maximum ):
for z in range( maximum ):
positive_Y = float( float(y+z+1)/float(w+x+y+z+2) * ( float(z+1)/float(y+z+2) ) )
negative_Y = float( float(w+x+1)/float(w+x+y+z+2) * ( float(x+1)/float... | true | true |
f74b529a7f987d099a7e084ae2958ad73cd8c2b7 | 796 | py | Python | pymatgen/phonon/tests/test_ir_spectra.py | dynikon/pymatgen | 6183f479e30a69bf5b94a0a7e21a3e810b40f02d | [
"MIT"
] | 6 | 2015-02-06T08:27:09.000Z | 2021-02-28T14:42:52.000Z | pymatgen/phonon/tests/test_ir_spectra.py | dynikon/pymatgen | 6183f479e30a69bf5b94a0a7e21a3e810b40f02d | [
"MIT"
] | null | null | null | pymatgen/phonon/tests/test_ir_spectra.py | dynikon/pymatgen | 6183f479e30a69bf5b94a0a7e21a3e810b40f02d | [
"MIT"
] | 3 | 2015-10-21T08:04:40.000Z | 2019-03-19T23:11:15.000Z | from __future__ import unicode_literals
import unittest
import os
from pymatgen.util.testing import PymatgenTest
from monty.serialization import loadfn
test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..",
'test_files')
class IRDielectricTensorTest(PymatgenTest):
def set... | 24.875 | 89 | 0.659548 | from __future__ import unicode_literals
import unittest
import os
from pymatgen.util.testing import PymatgenTest
from monty.serialization import loadfn
test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..",
'test_files')
class IRDielectricTensorTest(PymatgenTest):
def set... | true | true |
f74b52f2cf4f9ec85997cc43e098e38e3e0fada1 | 981 | py | Python | WDJN/bt_beam/data_prepare/get_resp2post.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 21 | 2020-12-16T08:53:38.000Z | 2022-01-21T09:08:55.000Z | WDJN/bt_beam/data_prepare/get_resp2post.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 1 | 2020-12-27T07:56:01.000Z | 2020-12-30T05:13:11.000Z | WDJN/bt_beam/data_prepare/get_resp2post.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 1 | 2022-02-28T12:19:19.000Z | 2022-02-28T12:19:19.000Z | import os
from collections import Counter
import copy
dialog_file = 'data/crowded_300k_jinyong_dialog_filter_sort.txt'
prob_file = 'data/crowded_300k_jinyong_dialog_probs_filter_sort.txt'
out_file = 'data/crowded_300k_jinyong_dialog_resp2post_5cand.txt'
n_cand = 5
dialog_data = []
with open(dialog_file) as f:
res... | 25.815789 | 68 | 0.614679 | import os
from collections import Counter
import copy
dialog_file = 'data/crowded_300k_jinyong_dialog_filter_sort.txt'
prob_file = 'data/crowded_300k_jinyong_dialog_probs_filter_sort.txt'
out_file = 'data/crowded_300k_jinyong_dialog_resp2post_5cand.txt'
n_cand = 5
dialog_data = []
with open(dialog_file) as f:
res... | true | true |
f74b5326ede435853f443c0f65388527b0dcf410 | 63,495 | py | Python | av98.py | atbradley/AV-98 | 265a69a6eda3fbad235db1c68edb21add2845a7c | [
"BSD-2-Clause"
] | 1 | 2021-09-22T22:20:10.000Z | 2021-09-22T22:20:10.000Z | av98.py | atbradley/AV-98 | 265a69a6eda3fbad235db1c68edb21add2845a7c | [
"BSD-2-Clause"
] | null | null | null | av98.py | atbradley/AV-98 | 265a69a6eda3fbad235db1c68edb21add2845a7c | [
"BSD-2-Clause"
] | 1 | 2021-09-24T18:49:20.000Z | 2021-09-24T18:49:20.000Z | #!/usr/bin/env python3
# AV-98 Gemini client
# Dervied from VF-1 (https://github.com/solderpunk/VF-1),
# (C) 2019, 2020 Solderpunk <solderpunk@sdf.org>
# With contributions from:
# - danceka <hannu.hartikainen@gmail.com>
# - <jprjr@tilde.club>
# - <vee@vnsf.xyz>
# - Klaus Alexander Seistrup <klaus@seistrup.dk>
# -... | 38.365559 | 141 | 0.563855 |
import argparse
import cmd
import cgi
import codecs
import collections
import datetime
import fnmatch
import getpass
import glob
import hashlib
import io
import mimetypes
import os
import os.path
import random
import shlex
import shutil
import socket
import sqlite3
import ssl
from ssl import CertificateError
import su... | true | true |
f74b5356b6bd58d90e988725ee62a11cb8cd44fc | 538 | py | Python | TwoFactorAuthenticationUser.py | ytyaru/GitHubUser.201704101437 | 611e6c33c9050ae6d65f81cedf769d0f85bd6615 | [
"CC0-1.0"
] | null | null | null | TwoFactorAuthenticationUser.py | ytyaru/GitHubUser.201704101437 | 611e6c33c9050ae6d65f81cedf769d0f85bd6615 | [
"CC0-1.0"
] | null | null | null | TwoFactorAuthenticationUser.py | ytyaru/GitHubUser.201704101437 | 611e6c33c9050ae6d65f81cedf769d0f85bd6615 | [
"CC0-1.0"
] | null | null | null | #!python3
#encoding:utf-8
from abc import ABCMeta, abstractmethod
import AGitHubUser
import BasicAuthenticationUser
class TwoFactorAuthenticationUser(BasicAuthenticationUser.BasicAuthenticationUser):
def __init__(self, username, password, secret):
super().__init__(username, password)
self.__secret =... | 29.888889 | 83 | 0.728625 | from abc import ABCMeta, abstractmethod
import AGitHubUser
import BasicAuthenticationUser
class TwoFactorAuthenticationUser(BasicAuthenticationUser.BasicAuthenticationUser):
def __init__(self, username, password, secret):
super().__init__(username, password)
self.__secret = secret
def __Get... | true | true |
f74b541b4ac3f784ea40e4e292f3d7e0e0e0bbbd | 7,172 | py | Python | src/beanmachine/ppl/legacy/inference/abstract_infer.py | feynmanliang/beanmachine | 5dea2b9f6387f2f7fd1e53b0915a1b8405f2b46b | [
"MIT"
] | null | null | null | src/beanmachine/ppl/legacy/inference/abstract_infer.py | feynmanliang/beanmachine | 5dea2b9f6387f2f7fd1e53b0915a1b8405f2b46b | [
"MIT"
] | null | null | null | src/beanmachine/ppl/legacy/inference/abstract_infer.py | feynmanliang/beanmachine | 5dea2b9f6387f2f7fd1e53b0915a1b8405f2b46b | [
"MIT"
] | 2 | 2022-03-09T06:07:13.000Z | 2022-03-11T05:37:26.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import platform
import random
from abc import ABCMeta, abstractmethod
from typing import ClassVar, Dict, List
import torch
i... | 34.815534 | 87 | 0.618795 |
import logging
import platform
import random
from abc import ABCMeta, abstractmethod
from typing import ClassVar, Dict, List
import torch
import torch.multiprocessing as mp
from beanmachine.ppl.inference.monte_carlo_samples import MonteCarloSamples
from beanmachine.ppl.inference.utils import (
_verify_queries_and... | true | true |
f74b5429d36fd8164090c045d7e04836bb2379a3 | 2,224 | py | Python | Chapter25/prototype.py | DeeMATT/AdvancedPythonProgramming | 97091dae4f177fd2c06b20265be2aedf9d1c41e7 | [
"MIT"
] | 55 | 2019-04-12T06:09:02.000Z | 2022-03-10T21:00:48.000Z | Chapter25/prototype.py | DeeMATT/AdvancedPythonProgramming | 97091dae4f177fd2c06b20265be2aedf9d1c41e7 | [
"MIT"
] | null | null | null | Chapter25/prototype.py | DeeMATT/AdvancedPythonProgramming | 97091dae4f177fd2c06b20265be2aedf9d1c41e7 | [
"MIT"
] | 29 | 2019-03-06T08:52:57.000Z | 2022-01-27T15:29:09.000Z | import copy
class Website:
def __init__(self, name, domain, description, author, **kwargs):
'''Examples of optional attributes (kwargs):
category, creation_date, technologies, keywords.
'''
self.name = name
self.domain = domain
self.description = description... | 29.653333 | 79 | 0.5625 | import copy
class Website:
def __init__(self, name, domain, description, author, **kwargs):
self.name = name
self.domain = domain
self.description = description
self.author = author
for key in kwargs:
setattr(self, key, kwargs[key])
def __str__... | true | true |
f74b556d44ab9a283deed604bb8f3e63da2b639d | 418 | py | Python | molecool/atom_data.py | alexvakimov/molecool | 511a56d8562efe08f584d2a76333a6ab742a6622 | [
"BSD-3-Clause"
] | 1 | 2020-03-05T10:13:44.000Z | 2020-03-05T10:13:44.000Z | molecool/atom_data.py | alexvakimov/molecool | 511a56d8562efe08f584d2a76333a6ab742a6622 | [
"BSD-3-Clause"
] | null | null | null | molecool/atom_data.py | alexvakimov/molecool | 511a56d8562efe08f584d2a76333a6ab742a6622 | [
"BSD-3-Clause"
] | null | null | null | """
atom_data.py
Data
stores the essential data
"""
atomic_weights = {
'H': 1.00784,
'C': 12.0107,
'N': 14.0067,
'O': 15.999,
'P': 30.973762,
'F': 18.998403,
'Cl': 35.453,
'Br': 79.904,
}
atom_colors = {
'H': 'white',
'C': '#D3D3D3',
'N': '#add8e6',
'O': 'red',
'... | 13.0625 | 25 | 0.435407 |
atomic_weights = {
'H': 1.00784,
'C': 12.0107,
'N': 14.0067,
'O': 15.999,
'P': 30.973762,
'F': 18.998403,
'Cl': 35.453,
'Br': 79.904,
}
atom_colors = {
'H': 'white',
'C': '#D3D3D3',
'N': '#add8e6',
'O': 'red',
'P': '#FFA500',
'F': '#FFFFE0',
'Cl': '#98FB98'... | true | true |
f74b559ee81810e9e4155751d90f916697b58b82 | 1,056 | py | Python | tests/unit/common/transports/test_common_base_transport.py | CESARBR/opencensus-python | d59ee42037499b25a9307025adeb32ca0681b544 | [
"Apache-2.0"
] | null | null | null | tests/unit/common/transports/test_common_base_transport.py | CESARBR/opencensus-python | d59ee42037499b25a9307025adeb32ca0681b544 | [
"Apache-2.0"
] | null | null | null | tests/unit/common/transports/test_common_base_transport.py | CESARBR/opencensus-python | d59ee42037499b25a9307025adeb32ca0681b544 | [
"Apache-2.0"
] | 1 | 2019-09-01T06:00:13.000Z | 2019-09-01T06:00:13.000Z | # Copyright 2018, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 32 | 74 | 0.731061 |
import unittest
class TestCommonBaseTransport(unittest.TestCase):
def test_export_abstract(self):
from opencensus.common.transports import base
transport = base.Transport()
trace = {}
with self.assertRaises(NotImplementedError):
transport.export(trace)
def test_... | true | true |
f74b561f653e9f54532a0230fd536c879ff9ff0d | 4,104 | py | Python | file_util.py | weiwei11/wind | 4322125ec7c66b33884b0886a98e52afdeda0ec9 | [
"MIT"
] | null | null | null | file_util.py | weiwei11/wind | 4322125ec7c66b33884b0886a98e52afdeda0ec9 | [
"MIT"
] | null | null | null | file_util.py | weiwei11/wind | 4322125ec7c66b33884b0886a98e52afdeda0ec9 | [
"MIT"
] | null | null | null | # @author: ww
import os
import pickle
import re
import yaml
def read_yaml(yaml_file):
"""
Read yaml file
:param yaml_file:
:return:
>>> read_yaml('test_resource/test_read.yml')
{'date': datetime.date(2019, 11, 6), 'pkg': {'python': {'version': '3.6.8', 'date': '{{ date }}'}, 'django': {'ver... | 25.65 | 210 | 0.601365 | import os
import pickle
import re
import yaml
def read_yaml(yaml_file):
with open(yaml_file) as f:
data_str = f.read()
data = yaml.safe_load(data_str)
return data
def write_yaml(yaml_file, data):
with open(yaml_file, 'w') as f:
yaml.dump(data, f)
def read_pickle(pkl_path):
... | true | true |
f74b56a9228a5e497eabfbb57451945a3d776de5 | 57 | py | Python | hxlti/lti_launch/__init__.py | nmaekawa/hxlti | 6c5b852b8964588a26f8932bd3ec92a7c790b6a0 | [
"BSD-3-Clause"
] | null | null | null | hxlti/lti_launch/__init__.py | nmaekawa/hxlti | 6c5b852b8964588a26f8932bd3ec92a7c790b6a0 | [
"BSD-3-Clause"
] | null | null | null | hxlti/lti_launch/__init__.py | nmaekawa/hxlti | 6c5b852b8964588a26f8932bd3ec92a7c790b6a0 | [
"BSD-3-Clause"
] | null | null | null | """the lti_launch module."""
from . import views # noqa
| 19 | 28 | 0.666667 | from . import views | true | true |
f74b5792d83fb390a9c2d864540485a0c51d8b17 | 383 | py | Python | ms4/asgi.py | cotebarrientos/4th-milestone-project-your-argentine-shop | 8b098f4a0fea73174b064eacd2b1c53dc1a61bc1 | [
"OLDAP-2.2.1"
] | null | null | null | ms4/asgi.py | cotebarrientos/4th-milestone-project-your-argentine-shop | 8b098f4a0fea73174b064eacd2b1c53dc1a61bc1 | [
"OLDAP-2.2.1"
] | 2 | 2021-04-27T16:04:31.000Z | 2021-05-04T22:02:26.000Z | ms4/asgi.py | cotebarrientos/4th-milestone-project-your-argentine-shop | 8b098f4a0fea73174b064eacd2b1c53dc1a61bc1 | [
"OLDAP-2.2.1"
] | 1 | 2021-06-22T19:50:03.000Z | 2021-06-22T19:50:03.000Z | """
ASGI config for ms4 project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_... | 22.529412 | 78 | 0.780679 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ms4.settings')
application = get_asgi_application()
| true | true |
f74b57d58aa7bda771b18c1a8886677189b878f8 | 22,589 | py | Python | ArchiveTestCode/Red Light Excited Visitor Simulator/LivingArchitectureEnv.py | UWaterloo-ASL/LAS_Gym | 916043d59aeca3deb8875abb280dcecbdcd50f0f | [
"MIT"
] | 1 | 2019-10-26T06:01:57.000Z | 2019-10-26T06:01:57.000Z | ArchiveTestCode/Red Light Excited Visitor Simulator/LivingArchitectureEnv.py | UWaterloo-ASL/LAS_Gym | 916043d59aeca3deb8875abb280dcecbdcd50f0f | [
"MIT"
] | 1 | 2018-05-08T20:28:32.000Z | 2018-05-08T20:28:32.000Z | ArchiveTestCode/Red Light Excited Visitor Simulator/LivingArchitectureEnv.py | UWaterloo-ASL/LAS_Gym | 916043d59aeca3deb8875abb280dcecbdcd50f0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 8 16:12:32 2018
@author: jack.lingheng.meng
"""
try:
import vrep
except:
print ('--------------------------------------------------------------')
print ('"vrep.py" could not be imported. This means very probably that')
print ('eithe... | 48.061702 | 187 | 0.608482 | try:
import vrep
except:
print ('--------------------------------------------------------------')
print ('"vrep.py" could not be imported. This means very probably that')
print ('either "vrep.py" or the remoteApi library could not be found.')
print ('Make sure both are in the same folder as this fil... | true | true |
f74b588b819f271ecc6869fb296a83be7b5bedd9 | 4,492 | py | Python | posthog/api/property_definition.py | csmatar/posthog | 4587cfe18625f302726c531f06a32c18e9749e9d | [
"MIT"
] | null | null | null | posthog/api/property_definition.py | csmatar/posthog | 4587cfe18625f302726c531f06a32c18e9749e9d | [
"MIT"
] | 15 | 2021-11-09T10:49:34.000Z | 2021-11-09T16:11:01.000Z | posthog/api/property_definition.py | csmatar/posthog | 4587cfe18625f302726c531f06a32c18e9749e9d | [
"MIT"
] | null | null | null | from typing import Type
from django.db import models
from rest_framework import mixins, permissions, serializers, viewsets
from posthog.api.routing import StructuredViewSetMixin
from posthog.constants import AvailableFeature
from posthog.exceptions import EnterpriseFeatureException
from posthog.filters import TermSea... | 43.192308 | 153 | 0.665405 | from typing import Type
from django.db import models
from rest_framework import mixins, permissions, serializers, viewsets
from posthog.api.routing import StructuredViewSetMixin
from posthog.constants import AvailableFeature
from posthog.exceptions import EnterpriseFeatureException
from posthog.filters import TermSea... | true | true |
f74b58c9aeb6ab60bbc541bc45dfa55c71c4ac71 | 20,787 | py | Python | ST_DM/GenRegion/src/generate/gen/regionalg.py | zhangyimi/Research | 866f91d9774a38d205d6e9a3b1ee6293748261b3 | [
"Apache-2.0"
] | 1,319 | 2020-02-14T10:42:07.000Z | 2022-03-31T15:42:18.000Z | ST_DM/GenRegion/src/generate/gen/regionalg.py | green9989/Research | 94519a72e7936c77f62a31709634b72c09aabf74 | [
"Apache-2.0"
] | 192 | 2020-02-14T02:53:34.000Z | 2022-03-31T02:25:48.000Z | ST_DM/GenRegion/src/generate/gen/regionalg.py | green9989/Research | 94519a72e7936c77f62a31709634b72c09aabf74 | [
"Apache-2.0"
] | 720 | 2020-02-14T02:12:38.000Z | 2022-03-31T12:21:15.000Z | # -*- coding: utf-8 -*-
########################################################################
#
# Copyright (c) 2019 Baidu.com, Inc. All Rights Reserved
#
########################################################################
import sys
import threading
from region import geometry as mygeo
from region import... | 27.605578 | 98 | 0.49531 |
import sys
import threading
from region import geometry as mygeo
from region import error
class Link(mygeo.Segment):
"""
Desc: 区域处理算法的link对象
"""
__slots__ = ("twin_link", "region")
def __init__(self, start, end):
"""
Desc: link就是一个mygeo.Segment, 记录了该link对应的region和twinlink
... | false | true |
f74b5b4d79b4fee293821f60f16da5aad884aebf | 2,730 | py | Python | opcua_plugin/pymodules/pymodbus-tcp/unittest/test.py | intelzhangw2/Converter-for-OPCUA | 70860637798ca94224aec3663d3ea3674a963c5a | [
"Apache-2.0"
] | 64 | 2018-08-30T05:18:54.000Z | 2022-03-23T14:33:42.000Z | opcua_plugin/pymodules/pymodbus-tcp/unittest/test.py | intelzhangw2/Converter-for-OPCUA | 70860637798ca94224aec3663d3ea3674a963c5a | [
"Apache-2.0"
] | null | null | null | opcua_plugin/pymodules/pymodbus-tcp/unittest/test.py | intelzhangw2/Converter-for-OPCUA | 70860637798ca94224aec3663d3ea3674a963c5a | [
"Apache-2.0"
] | 29 | 2018-10-26T06:17:50.000Z | 2021-05-10T07:34:35.000Z | # -*- coding: UTF-8 -*-
# Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 28.14433 | 74 | 0.617216 |
import sys
sys.path.insert(0, '../../../../pyutilities')
from mqservice import MsgQueueService
class Unittest(object):
def __init__(self):
self.queue = 'ModbusPlugin-TCP'
self.mq_serv = MsgQueueService('test_queue')
self.mq_serv.set_callback(self._recv)
self.mq_serv.start(daemo... | true | true |
f74b5de87012e43d3e7bc3c183ecb17836a9e94b | 12,976 | py | Python | PELEAnalysis-Processing/Preprocessing/PDBProcessor4PELE.py | SergiR1996/PELEAnalysis-Processing | ad844f14487998eb963186d3b8f314cc9307df28 | [
"MIT"
] | 3 | 2021-02-25T11:56:42.000Z | 2022-02-08T13:23:21.000Z | PELEAnalysis-Processing/Preprocessing/PDBProcessor4PELE.py | SergiR1996/PELEAnalysis-Processing | ad844f14487998eb963186d3b8f314cc9307df28 | [
"MIT"
] | null | null | null | PELEAnalysis-Processing/Preprocessing/PDBProcessor4PELE.py | SergiR1996/PELEAnalysis-Processing | ad844f14487998eb963186d3b8f314cc9307df28 | [
"MIT"
] | 1 | 2022-01-10T15:57:19.000Z | 2022-01-10T15:57:19.000Z | # -*- coding: utf-8 -*-
# Global imports
import os,re
import glob
import argparse as ap
# Local imports
from StorePDBFilenames import *
# Script information
__author__ = "Sergi Rodà"
__license__ = "MIT"
__version__ = "1.0.1"
__maintainer__ = "Sergi Rodà"
__email__ = "sergi.rodallordes@bsc.es"
# Global variables
Pro... | 49.338403 | 193 | 0.574599 |
import os,re
import glob
import argparse as ap
from StorePDBFilenames import *
__author__ = "Sergi Rodà"
__license__ = "MIT"
__version__ = "1.0.1"
__maintainer__ = "Sergi Rodà"
__email__ = "sergi.rodallordes@bsc.es"
Protein_list = ["GLY","ALA","VAL","LEU","ILE","SER","THR","ARG","LYS","PHE","TYR","TRP","ASP","GLU",... | true | true |
f74b5f6e5b299c28669c8aea172739178fcdcbc2 | 1,741 | py | Python | src/levitas/middleware/appMiddleware.py | tobi-weber/levitas | b14fb4135839611ace652b9f43cbe5a7fa5e3b66 | [
"Apache-2.0"
] | 1 | 2018-02-27T00:28:29.000Z | 2018-02-27T00:28:29.000Z | src/levitas/middleware/appMiddleware.py | tobi-weber/levitas | b14fb4135839611ace652b9f43cbe5a7fa5e3b66 | [
"Apache-2.0"
] | null | null | null | src/levitas/middleware/appMiddleware.py | tobi-weber/levitas | b14fb4135839611ace652b9f43cbe5a7fa5e3b66 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2010-2014 Tobias Weber <tobi-weber@gmx.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 30.54386 | 74 | 0.612866 |
import os
import logging
from .fileMiddleware import FileMiddleware
log = logging.getLogger("levitas.middleware.appMiddleware")
class AppMiddleware(FileMiddleware):
LOG = True
def __init__(self, path, disable_http_caching=False):
FileMiddleware.__init__(self, path)
if disable_http... | true | true |
f74b5f85b8859834c91df8e50385c90d7329911d | 7,648 | py | Python | kcwidrp/primitives/FluxCalibrate.py | Keck-DataReductionPipelines/KCWI_DRP | 5073a137a8edddf9ff894aef445f877d7186a355 | [
"BSD-3-Clause"
] | 5 | 2020-04-09T20:05:52.000Z | 2021-08-04T18:04:28.000Z | kcwidrp/primitives/FluxCalibrate.py | Keck-DataReductionPipelines/KCWI_DRP | 5073a137a8edddf9ff894aef445f877d7186a355 | [
"BSD-3-Clause"
] | 80 | 2020-03-19T00:35:27.000Z | 2022-03-07T20:08:23.000Z | kcwidrp/primitives/FluxCalibrate.py | Keck-DataReductionPipelines/KCWI_DRP | 5073a137a8edddf9ff894aef445f877d7186a355 | [
"BSD-3-Clause"
] | 9 | 2021-01-22T02:00:32.000Z | 2022-02-08T19:43:16.000Z | from keckdrpframework.primitives.base_primitive import BasePrimitive
from kcwidrp.primitives.kcwi_file_primitives import kcwi_fits_writer, \
kcwi_fits_reader, get_master_name, strip_fname
from kcwidrp.core.kcwi_correct_extin import kcwi_correct_extin
import os
import numpy as np
from scipy.interpolate import inter... | 42.254144 | 81 | 0.528373 | from keckdrpframework.primitives.base_primitive import BasePrimitive
from kcwidrp.primitives.kcwi_file_primitives import kcwi_fits_writer, \
kcwi_fits_reader, get_master_name, strip_fname
from kcwidrp.core.kcwi_correct_extin import kcwi_correct_extin
import os
import numpy as np
from scipy.interpolate import inter... | true | true |
f74b5fbe0c59dcd361a188c982cba1ab8aa266f3 | 1,174 | py | Python | setup.py | kuchel77/pyhealthchecks | bc0c40029031cd248a3951798c1735d48c4d81ab | [
"Apache-2.0"
] | null | null | null | setup.py | kuchel77/pyhealthchecks | bc0c40029031cd248a3951798c1735d48c4d81ab | [
"Apache-2.0"
] | null | null | null | setup.py | kuchel77/pyhealthchecks | bc0c40029031cd248a3951798c1735d48c4d81ab | [
"Apache-2.0"
] | null | null | null | """ Setup for pyHealthchecks """
import os
from setuptools import setup, find_packages
NAME = "pyhealthchecks"
AUTHOR = "Mark Kuchel"
AUTHOR_EMAIL = "mark@kuchel.net"
DESCRIPTION = "An async client library for ping HealthChecks.io"
URL = "https://github.com/kuchel77/pyhealthchecks"
REQUIRES = [
'aiohttp>=3.5.4'
... | 26.681818 | 64 | 0.67632 | import os
from setuptools import setup, find_packages
NAME = "pyhealthchecks"
AUTHOR = "Mark Kuchel"
AUTHOR_EMAIL = "mark@kuchel.net"
DESCRIPTION = "An async client library for ping HealthChecks.io"
URL = "https://github.com/kuchel77/pyhealthchecks"
REQUIRES = [
'aiohttp>=3.5.4'
]
with open("README.md", "r") a... | true | true |
f74b611b91c6ee4af3e8a949f8dd346869bc093f | 5,585 | py | Python | evaluation/memcached/second_run_gear_images_without_cache.py | seveirbian/gear-old | 8d3529a9bf42e652a9d7475c9d14e9a6afc69a76 | [
"Apache-2.0"
] | null | null | null | evaluation/memcached/second_run_gear_images_without_cache.py | seveirbian/gear-old | 8d3529a9bf42e652a9d7475c9d14e9a6afc69a76 | [
"Apache-2.0"
] | null | null | null | evaluation/memcached/second_run_gear_images_without_cache.py | seveirbian/gear-old | 8d3529a9bf42e652a9d7475c9d14e9a6afc69a76 | [
"Apache-2.0"
] | null | null | null | import sys
# package need to be installed, pip install docker
import docker
import time
import yaml
import os
import random
import subprocess
import signal
import urllib2
import shutil
import xlwt
# package need to be installed, apt-get install python-memcache
import memcache
auto = False
private_registry = "202.114... | 29.088542 | 109 | 0.515667 | import sys
import docker
import time
import yaml
import os
import random
import subprocess
import signal
import urllib2
import shutil
import xlwt
import memcache
auto = False
private_registry = "202.114.10.146:9999/"
suffix = "-gearmd"
apppath = ""
hostPort = 11211
localVolume = ""
pwd = os.path.split(os.path.real... | false | true |
f74b61381caf09ae5485a717f4a0e59c7848f4c6 | 419 | py | Python | Solutions/6-kyu/Eureka/main.py | Reverend-Toady/365-Days-of-Code | 88f699654ab8427d007da8a7ecbf3308952f81e8 | [
"MIT"
] | 1 | 2022-02-11T17:19:29.000Z | 2022-02-11T17:19:29.000Z | Solutions/6-kyu/Eureka/main.py | Reverend-Toady/365-Days-of-Code | 88f699654ab8427d007da8a7ecbf3308952f81e8 | [
"MIT"
] | null | null | null | Solutions/6-kyu/Eureka/main.py | Reverend-Toady/365-Days-of-Code | 88f699654ab8427d007da8a7ecbf3308952f81e8 | [
"MIT"
] | null | null | null | def sum_dig_pow(a, b):
res = []
for i in range(a, b + 1):
temp = []
for idx, elem in enumerate(str(i), start=1):
# print(elem, idx)
# print(int(elem) ** idx)
temp.append(int(elem) ** idx)
# print(temp)
# print(i, sum(temp))
if sum(temp)... | 23.277778 | 52 | 0.472554 | def sum_dig_pow(a, b):
res = []
for i in range(a, b + 1):
temp = []
for idx, elem in enumerate(str(i), start=1):
temp.append(int(elem) ** idx)
if sum(temp) == i:
res.append(i)
return res if res else []
x = sum_dig_pow(... | true | true |
f74b6140204c5d56fa5f872e5e75c62e6ed3b64a | 701 | py | Python | database/models.py | christopherthompson81/fastapi_demo | be6f2486ce810c9574fafb506a153560d1cbcd5e | [
"MIT"
] | 5 | 2019-07-15T21:19:47.000Z | 2021-08-07T16:37:25.000Z | database/models.py | christopherthompson81/fastapi_demo | be6f2486ce810c9574fafb506a153560d1cbcd5e | [
"MIT"
] | null | null | null | database/models.py | christopherthompson81/fastapi_demo | be6f2486ce810c9574fafb506a153560d1cbcd5e | [
"MIT"
] | 1 | 2019-08-29T02:51:38.000Z | 2019-08-29T02:51:38.000Z | '''
FastAPI Demo
SQLAlchemy ORM Models
'''
# Standard Imports
# PyPi Imports
from sqlalchemy import (
Boolean,
Column,
Integer,
String
)
# Local Imports
from database.setup import Base
###############################################################################
class User(Base):
'''ORM Models - users'''
_... | 21.90625 | 79 | 0.661912 |
from sqlalchemy import (
Boolean,
Column,
Integer,
String
)
from database.setup import Base
class User(Base):
__tablename__ = "users"
user_id = Column(Integer, primary_key=True, index=True)
username = Column(String, unique=True)
salted_password_hash = Column(String)
first_name = Column(String)
last_name =... | true | true |
f74b61915f0a4e900709b2251708bd32e35797e7 | 1,945 | py | Python | main.py | shmouses/EELSpecNet | a9aa085782a08e903e718012d5ce5979c18f7d23 | [
"MIT"
] | 2 | 2021-02-16T19:05:54.000Z | 2022-02-18T04:36:58.000Z | main.py | shmouses/EELSpecNet | a9aa085782a08e903e718012d5ce5979c18f7d23 | [
"MIT"
] | null | null | null | main.py | shmouses/EELSpecNet | a9aa085782a08e903e718012d5ce5979c18f7d23 | [
"MIT"
] | 2 | 2021-07-15T17:33:31.000Z | 2022-03-18T11:48:30.000Z | import EELSpecNet
import GenerateData as gene
import tensorflow as tf
import numpy as np
import tensorflow.experimental.numpy as tnp
tnp.experimental_enable_numpy_behavior()
def main():
model = EELSpecNet.EELSpecNetModel_CNN_10D(2048)
op = tf.keras.optimizers.Adam(learning_rate=5e-5)
model.compile(optimiz... | 43.222222 | 119 | 0.645244 | import EELSpecNet
import GenerateData as gene
import tensorflow as tf
import numpy as np
import tensorflow.experimental.numpy as tnp
tnp.experimental_enable_numpy_behavior()
def main():
model = EELSpecNet.EELSpecNetModel_CNN_10D(2048)
op = tf.keras.optimizers.Adam(learning_rate=5e-5)
model.compile(optimiz... | true | true |
f74b61e7a0de0b7dcff3c3cedc5a09c6e2d9148e | 23,755 | py | Python | pymc/distributions/shape_utils.py | MarcoGorelli/pymc | 140dab0199dfb751951ba99175295c07feb00264 | [
"Apache-2.0"
] | 9 | 2018-07-11T03:10:25.000Z | 2018-07-19T18:59:05.000Z | pymc/distributions/shape_utils.py | MarcoGorelli/pymc | 140dab0199dfb751951ba99175295c07feb00264 | [
"Apache-2.0"
] | 8 | 2020-11-02T17:24:34.000Z | 2021-08-30T18:24:07.000Z | pymc/distributions/shape_utils.py | ricardoV94/pymc | 75ea2a80cb27773e93b7b207043077953940e6ff | [
"Apache-2.0"
] | 1 | 2017-07-18T21:59:15.000Z | 2017-07-18T21:59:15.000Z | # Copyright 2021 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.780381 | 143 | 0.619196 |
import warnings
from typing import Optional, Sequence, Tuple, Union
import numpy as np
from aesara.graph.basic import Constant, Variable
from aesara.tensor.var import TensorVariable
from pymc.aesaraf import change_rv_size, pandas_to_array
from pymc.exceptions import ShapeError, ShapeWarning
__all__ = [
"to_t... | true | true |
f74b6221541098f572b30e117d155e82916feb5d | 5,701 | py | Python | var/spack/repos/builtin/packages/nsimd/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2021-09-29T02:14:40.000Z | 2022-01-27T20:50:36.000Z | var/spack/repos/builtin/packages/nsimd/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2022-02-28T11:30:18.000Z | 2022-03-23T19:34:56.000Z | var/spack/repos/builtin/packages/nsimd/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Nsimd(CMakePackage):
"""NSIMD is a vectorization library that abstracts SIMD programming.
It was designed to ... | 42.544776 | 95 | 0.574461 | class Nsimd(CMakePackage):
homepage = "https://agenium-scale.github.io/nsimd/"
url = "https://github.com/agenium-scale/nsimd/archive/v1.0.tar.gz"
maintainers = ['eschnett']
version('3.0.1', sha256='6a90d7ce5f9da5cfac872463951f3374bb0e0824d92f714db0fd4901b32497fd')
version('3.0', sha256='5cab... | true | true |
f74b62cb11257ff24a6606b1b05c3851c2ceffa4 | 2,523 | py | Python | ontask/dataops/urls.py | pinheiroo27/ontask_b | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | [
"MIT"
] | 33 | 2017-12-02T04:09:24.000Z | 2021-11-07T08:41:57.000Z | ontask/dataops/urls.py | pinheiroo27/ontask_b | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | [
"MIT"
] | 189 | 2017-11-16T04:06:29.000Z | 2022-03-11T23:35:59.000Z | ontask/dataops/urls.py | pinheiroo27/ontask_b | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | [
"MIT"
] | 30 | 2017-11-30T03:35:44.000Z | 2022-01-31T03:08:08.000Z | # -*- coding: utf-8 -*-
"""Views to manipulate dataframes."""
from django.urls import path
from ontask import models
from ontask.dataops import services, views
from ontask.tasks import task_execute_factory
app_name = 'dataops'
urlpatterns = [
# Show the upload merge menu
path('uploadmerge/', views.uploadmerg... | 28.348315 | 79 | 0.689259 |
from django.urls import path
from ontask import models
from ontask.dataops import services, views
from ontask.tasks import task_execute_factory
app_name = 'dataops'
urlpatterns = [
path('uploadmerge/', views.uploadmerge, name='uploadmerge'),
path('plugin_admin/', views.plugin_admin, name='plugin_adm... | true | true |
f74b634edcb2fc07b8b5f6cae2acd4b51261f5b1 | 2,402 | py | Python | data_/data_save.py | zouguojian/FDN-Learning | ef89cb7d6654d5ac2425621ec6b330652a281f16 | [
"MIT"
] | 1 | 2021-03-24T10:59:27.000Z | 2021-03-24T10:59:27.000Z | data_/data_save.py | zouguojian/FDN-Learning | ef89cb7d6654d5ac2425621ec6b330652a281f16 | [
"MIT"
] | null | null | null | data_/data_save.py | zouguojian/FDN-Learning | ef89cb7d6654d5ac2425621ec6b330652a281f16 | [
"MIT"
] | null | null | null | # -- coding: utf-8 --
import os
import csv
def go_though(open_file):
for root, dirs, files in os.walk(r''+str(open_file)):
for file in files:
# # 获取文件所属目录
# print(root)
# 获取文件路径
print(os.path.join(root, file))
def re_hour(hour):
if len(str(hour))<2:retu... | 31.605263 | 150 | 0.633639 |
import os
import csv
def go_though(open_file):
for root, dirs, files in os.walk(r''+str(open_file)):
for file in files:
print(os.path.join(root, file))
def re_hour(hour):
if len(str(hour))<2:return '0'+str(hour)
else:return str(hour)
def re_month(m... | true | true |
f74b6494843ca07cb553372ee10336a9aa839bf1 | 1,244 | py | Python | tensorflow_datasets/image/clic_test.py | loganlebanoff/datasets | 44649ac4f8fefdbaae0a66918b03ae7dd8169f1e | [
"Apache-2.0"
] | 2 | 2020-10-12T07:09:38.000Z | 2021-03-05T12:48:23.000Z | tensorflow_datasets/image/clic_test.py | loganlebanoff/datasets | 44649ac4f8fefdbaae0a66918b03ae7dd8169f1e | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/image/clic_test.py | loganlebanoff/datasets | 44649ac4f8fefdbaae0a66918b03ae7dd8169f1e | [
"Apache-2.0"
] | 1 | 2021-02-20T06:52:51.000Z | 2021-02-20T06:52:51.000Z | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 27.644444 | 74 | 0.715434 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_datasets.image import clic
import tensorflow_datasets.public_api as tfds
class ClicTest(tfds.testing.DatasetBuilderTestCase):
DATASET_CLASS = clic.CLIC
SPLITS = {
"train": 1,
... | true | true |
f74b64ce8133d98c84536931a67d3bb10744666d | 596 | py | Python | utest/phylib/fieldmap/dat_util.py | frib-high-level-controls/phyhlc | 6486607e3aa0212054a12e9f2ad1a3ef15542f48 | [
"BSD-3-Clause"
] | 1 | 2018-03-22T15:18:54.000Z | 2018-03-22T15:18:54.000Z | utest/phylib/fieldmap/dat_util.py | frib-high-level-controls/phyhlc | 6486607e3aa0212054a12e9f2ad1a3ef15542f48 | [
"BSD-3-Clause"
] | null | null | null | utest/phylib/fieldmap/dat_util.py | frib-high-level-controls/phyhlc | 6486607e3aa0212054a12e9f2ad1a3ef15542f48 | [
"BSD-3-Clause"
] | null | null | null |
import sys, fmdata
"""
Simple script to extract a 'test' data set from a real '.dat' file.
"""
f = open(sys.argv[1], "r")
d = fmdata.readFromDatFile(f)
f.close()
linenums = []
for x in xrange(0, d.nx, 2):
for y in xrange(0, d.ny, 2):
for z in xrange(0, d.nz, 6):
linenums.append(x*d.ny*d.nz +... | 18.625 | 67 | 0.597315 |
import sys, fmdata
f = open(sys.argv[1], "r")
d = fmdata.readFromDatFile(f)
f.close()
linenums = []
for x in xrange(0, d.nx, 2):
for y in xrange(0, d.ny, 2):
for z in xrange(0, d.nz, 6):
linenums.append(x*d.ny*d.nz + y*d.nz + z)
linenums.sort()
f = open(sys.argv[1], "r")
sys.stdout.write(f... | true | true |
f74b6585ed7f496875d97c3e06f161537bd0c575 | 4,115 | py | Python | dataflow/insertDatabaseVolumeChange.py | eliasho/dataflow | 236676619a0490f61d921e6be078593c82503bd2 | [
"MIT"
] | 1 | 2018-05-22T14:46:48.000Z | 2018-05-22T14:46:48.000Z | dataflow/insertDatabaseVolumeChange.py | eliasho/dataflow | 236676619a0490f61d921e6be078593c82503bd2 | [
"MIT"
] | 22 | 2018-05-18T15:28:48.000Z | 2019-09-05T06:19:33.000Z | dataflow/insertDatabaseVolumeChange.py | eliasho/dataflow | 236676619a0490f61d921e6be078593c82503bd2 | [
"MIT"
] | 4 | 2018-07-09T05:08:49.000Z | 2021-03-23T08:19:36.000Z | '''
Created on 11.07.2018
@author: yvo
Main script to import all VAW volume change data files into the GLAMOS database.
'''
import configparser
import os
from dataflow.DataReaders.DatabaseReaders.GlacierReader import GlacierReader
from dataflow.DataObjects.Exceptions.GlacierNotFoundError import GlacierNotFoundError... | 41.989796 | 133 | 0.632807 |
import configparser
import os
from dataflow.DataReaders.DatabaseReaders.GlacierReader import GlacierReader
from dataflow.DataObjects.Exceptions.GlacierNotFoundError import GlacierNotFoundError
from dataflow.DataWriters.DatabaseWriters.VolumeChangeWriter import VolumeChangeWriter
from dataflow.DataReaders.VawFileReade... | true | true |
f74b6661f50f6be8089ef7597752df974ff10d55 | 13,095 | py | Python | pygcam/windows.py | tpike3/pygcam | da0f11e373d4cd99125ce81c5de17d795d8f6d7e | [
"MIT"
] | 18 | 2017-06-15T01:28:46.000Z | 2022-03-30T03:13:35.000Z | pygcam/windows.py | tpike3/pygcam | da0f11e373d4cd99125ce81c5de17d795d8f6d7e | [
"MIT"
] | 8 | 2020-04-03T19:38:14.000Z | 2022-03-03T17:12:17.000Z | pygcam/windows.py | tpike3/pygcam | da0f11e373d4cd99125ce81c5de17d795d8f6d7e | [
"MIT"
] | 10 | 2017-08-13T17:24:03.000Z | 2022-03-06T13:39:25.000Z | '''
.. Stuff specific to MS Windows
.. Copyright (c) 2016 Richard Plevin
See the https://opensource.org/licenses/MIT for license details.
'''
from __future__ import print_function
import os
import platform
from errno import EEXIST
from .config import getParamAsBoolean, unixPath
IsWindows = platform.system() == 'Win... | 39.92378 | 119 | 0.593891 | from __future__ import print_function
import os
import platform
from errno import EEXIST
from .config import getParamAsBoolean, unixPath
IsWindows = platform.system() == 'Windows'
if IsWindows:
import ctypes
import win32file
from pygcam.error import PygcamException
_sopen = ctypes.cdll.msvcr... | true | true |
f74b668af4721a8183b794a4d69ab5aac2b14f6a | 8,586 | py | Python | xgcm/test/test_metrics_ops_single_axis.py | rcaneill/xgcm-1 | b68a4c70fdb8ade2e7462a958c810a07b0fbcfdb | [
"MIT"
] | null | null | null | xgcm/test/test_metrics_ops_single_axis.py | rcaneill/xgcm-1 | b68a4c70fdb8ade2e7462a958c810a07b0fbcfdb | [
"MIT"
] | null | null | null | xgcm/test/test_metrics_ops_single_axis.py | rcaneill/xgcm-1 | b68a4c70fdb8ade2e7462a958c810a07b0fbcfdb | [
"MIT"
] | null | null | null | from __future__ import print_function
import pytest
import xarray as xr
import numpy as np
from xgcm.grid import Grid, Axis
from xgcm.test.datasets import datasets_grid_metric
@pytest.mark.parametrize("funcname", ["interp", "diff", "min", "max", "cumsum"])
@pytest.mark.parametrize("grid_type", ["B", "C"])
@pytest.ma... | 34.481928 | 104 | 0.593524 | from __future__ import print_function
import pytest
import xarray as xr
import numpy as np
from xgcm.grid import Grid, Axis
from xgcm.test.datasets import datasets_grid_metric
@pytest.mark.parametrize("funcname", ["interp", "diff", "min", "max", "cumsum"])
@pytest.mark.parametrize("grid_type", ["B", "C"])
@pytest.ma... | true | true |
f74b676f8963fe8d51569715661dc3bf4373e0c9 | 3,959 | py | Python | migrations/versions/2018_03_22_user_model_refactor_.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | null | null | null | migrations/versions/2018_03_22_user_model_refactor_.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | null | null | null | migrations/versions/2018_03_22_user_model_refactor_.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | null | null | null | """empty message
Revision ID: 2018_03_22_user_model_refactor
Revises: 2018_03_20_remove_unused_fields
Create Date: 2018-03-22 10:23:42.850491
"""
from alembic import op
import sqlalchemy as sa
from psycopg2._psycopg import ProgrammingError
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql... | 34.426087 | 109 | 0.643849 | from alembic import op
import sqlalchemy as sa
from psycopg2._psycopg import ProgrammingError
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
revision = '2018_03_22_... | true | true |
f74b680d4da3db38dbb655abf00737dca754d83f | 692 | py | Python | tests/test_util.py | TurconiAndrea/recipe-tagger | b5227a2a8a3575ac18b4c47e792353fba8841132 | [
"MIT"
] | 1 | 2021-12-27T17:34:47.000Z | 2021-12-27T17:34:47.000Z | tests/test_util.py | TurconiAndrea/recipe-tagger | b5227a2a8a3575ac18b4c47e792353fba8841132 | [
"MIT"
] | null | null | null | tests/test_util.py | TurconiAndrea/recipe-tagger | b5227a2a8a3575ac18b4c47e792353fba8841132 | [
"MIT"
] | null | null | null | """
Module containg all the tests provided for the util module.
"""
import pytest
from recipe_tagger import util
# @pytest.mark.skip()
def test_process_ingredient():
"""
Test for process_ingredient method.
Test is passed only if the provided ingredient is processed correctly.
"""
assert (
... | 27.68 | 86 | 0.683526 |
import pytest
from recipe_tagger import util
def test_process_ingredient():
assert (
util.process_ingredients("farm eggs without antibiotics", language="en")
== "egg"
)
assert util.process_ingredients("frozen tomatoes", language="en") == "tomato"
assert util.process_ingredients("pomo... | true | true |
f74b685d87788090c79eb67021967a419f8e3841 | 1,700 | py | Python | dsne/networks/lenetplus.py | ShownX/d-SNE | 7a8ecdf43d0cbcafae3ad81a60c4eeb21ee228e2 | [
"Apache-2.0"
] | 1 | 2020-03-28T03:34:18.000Z | 2020-03-28T03:34:18.000Z | dsne/networks/lenetplus.py | ShownX/d-SNE | 7a8ecdf43d0cbcafae3ad81a60c4eeb21ee228e2 | [
"Apache-2.0"
] | null | null | null | dsne/networks/lenetplus.py | ShownX/d-SNE | 7a8ecdf43d0cbcafae3ad81a60c4eeb21ee228e2 | [
"Apache-2.0"
] | null | null | null | from mxnet import gluon
def _make_conv_block(block_index, num_chan=32, num_layer=2, stride=1, pad=2):
out = gluon.nn.HybridSequential(prefix='block_%d_' % block_index)
with out.name_scope():
for _ in range(num_layer):
out.add(gluon.nn.Conv2D(num_chan, kernel_size=3, strides=stride, padding... | 32.075472 | 120 | 0.605294 | from mxnet import gluon
def _make_conv_block(block_index, num_chan=32, num_layer=2, stride=1, pad=2):
out = gluon.nn.HybridSequential(prefix='block_%d_' % block_index)
with out.name_scope():
for _ in range(num_layer):
out.add(gluon.nn.Conv2D(num_chan, kernel_size=3, strides=stride, padding... | true | true |
f74b68db1cf2bb337c599a06ded5069a88c49835 | 5,393 | py | Python | xutil/tests/database_test.py | flarco/n1slutil | 2c9f23c2240b4d94507ae799b417060688293979 | [
"MIT"
] | 1 | 2019-07-06T16:01:25.000Z | 2019-07-06T16:01:25.000Z | xutil/tests/database_test.py | flarco/n1slutil | 2c9f23c2240b4d94507ae799b417060688293979 | [
"MIT"
] | null | null | null | xutil/tests/database_test.py | flarco/n1slutil | 2c9f23c2240b4d94507ae799b417060688293979 | [
"MIT"
] | null | null | null | # from parent folder, run 'python -m xutil.tests.helpers_test'
import unittest, os
from path import Path
from unittest.mock import patch
from xutil.helpers import *
from xutil.database.base import get_conn
import docker # https://github.com/docker/docker-py
from collections import namedtuple
class BaseDBTest(unit... | 30.128492 | 115 | 0.643241 | import unittest, os
from path import Path
from unittest.mock import patch
from xutil.helpers import *
from xutil.database.base import get_conn
import docker
from collections import namedtuple
class BaseDBTest(unittest.TestCase):
timeout = 40
@classmethod
def setUpClass(cls):
cls.client = docker.from_en... | true | true |
f74b69dc23f820505fdf9db30768285cd1ba32d8 | 1,337 | py | Python | mmdepth/configs/new_exps/ablations/nyu_swin_large_baseline.py | zhyever/DepthFormer | 5e9b49a48bd1654373e6a4ca3976d4de6f1d6941 | [
"Apache-2.0"
] | 4 | 2022-03-21T01:49:05.000Z | 2022-03-21T12:37:52.000Z | mmdepth/configs/new_exps/ablations/nyu_swin_large_baseline.py | zhyever/DepthFormer | 5e9b49a48bd1654373e6a4ca3976d4de6f1d6941 | [
"Apache-2.0"
] | null | null | null | mmdepth/configs/new_exps/ablations/nyu_swin_large_baseline.py | zhyever/DepthFormer | 5e9b49a48bd1654373e6a4ca3976d4de6f1d6941 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../_base_/models/swin_base.py', '../../_base_/datasets/nyu.py',
'../../_base_/iter_runtime.py', '../../_base_/schedules/schedule_cos24x_iter.py'
]
model = dict(
pretrained='./nfs/checkpoints/swin_large_patch4_window12_384_22k.pth', # noqa
backbone=dict(
pretrain_img_size=384,
... | 28.446809 | 84 | 0.594615 | _base_ = [
'../../_base_/models/swin_base.py', '../../_base_/datasets/nyu.py',
'../../_base_/iter_runtime.py', '../../_base_/schedules/schedule_cos24x_iter.py'
]
model = dict(
pretrained='./nfs/checkpoints/swin_large_patch4_window12_384_22k.pth', backbone=dict(
pretrain_img_size=384,
em... | true | true |
f74b6a26140bb080c0321482254282099767c644 | 1,677 | py | Python | main.py | PerpetualSmile/Space_Invasion | fefb87f96a297fc27f9435f7d7c17dbad63f9e81 | [
"MIT"
] | 1 | 2020-12-26T12:06:52.000Z | 2020-12-26T12:06:52.000Z | main.py | PerpetualSmile/Space_Invasion | fefb87f96a297fc27f9435f7d7c17dbad63f9e81 | [
"MIT"
] | null | null | null | main.py | PerpetualSmile/Space_Invasion | fefb87f96a297fc27f9435f7d7c17dbad63f9e81 | [
"MIT"
] | 1 | 2019-05-15T02:10:51.000Z | 2019-05-15T02:10:51.000Z | import pygame
from pygame.sprite import Group
from settings import Settings
from ship import Ship
import game_functions as gf
from game_stats import GameStats
from button import Button
from scoreboard import Scoreboard
from mouse_move import MouseMove
from musics import Musics
def run_game():
# 初始化游戏并且创建一个屏幕对象
... | 25.029851 | 121 | 0.699463 | import pygame
from pygame.sprite import Group
from settings import Settings
from ship import Ship
import game_functions as gf
from game_stats import GameStats
from button import Button
from scoreboard import Scoreboard
from mouse_move import MouseMove
from musics import Musics
def run_game():
pygame.init()
... | true | true |
f74b6a598a21da299d70fb28fb84845c2aa477ba | 4,803 | py | Python | lab_2/graphics.py | syth0le/mat_mod_labs | 9c87e771beb75566bb824e34f4520e8b2ca0a4ce | [
"Apache-2.0"
] | null | null | null | lab_2/graphics.py | syth0le/mat_mod_labs | 9c87e771beb75566bb824e34f4520e8b2ca0a4ce | [
"Apache-2.0"
] | null | null | null | lab_2/graphics.py | syth0le/mat_mod_labs | 9c87e771beb75566bb824e34f4520e8b2ca0a4ce | [
"Apache-2.0"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
from scipy import interpolate
from abc import ABCMeta, abstractmethod
from utils.sorting import bubble_sort
class ABSMethods(metaclass=ABCMeta):
def __init__(self, function):
self.function = function
@abstractmethod
def drawGraphic(self, ve... | 27.135593 | 103 | 0.486363 | import numpy as np
from matplotlib import pyplot as plt
from scipy import interpolate
from abc import ABCMeta, abstractmethod
from utils.sorting import bubble_sort
class ABSMethods(metaclass=ABCMeta):
def __init__(self, function):
self.function = function
@abstractmethod
def drawGraphic(self, ve... | true | true |
f74b6aedd7f3e36aed59d665552fdf2b734afe95 | 1,318 | py | Python | plugins/default/metasploit_attacks/metasploit_screengrab_t1113/metasploit_screengrab.py | Thorsten-Sick/PurpleDome | 297d746ef2e17a4207f8274b7fccbe2ce43c4a5f | [
"MIT"
] | 7 | 2021-11-30T19:54:29.000Z | 2022-03-05T23:15:23.000Z | plugins/default/metasploit_attacks/metasploit_screengrab_t1113/metasploit_screengrab.py | Thorsten-Sick/PurpleDome | 297d746ef2e17a4207f8274b7fccbe2ce43c4a5f | [
"MIT"
] | null | null | null | plugins/default/metasploit_attacks/metasploit_screengrab_t1113/metasploit_screengrab.py | Thorsten-Sick/PurpleDome | 297d746ef2e17a4207f8274b7fccbe2ce43c4a5f | [
"MIT"
] | 2 | 2021-11-30T11:16:27.000Z | 2022-02-02T13:36:01.000Z | #!/usr/bin/env python3
# A plugin to nmap targets slow motion, to evade sensors
from plugins.base.attack import AttackPlugin, Requirement
class MetasploitScreengrabPlugin(AttackPlugin):
# Boilerplate
name = "metasploit_screengrab"
description = "Grab a screenshot"
ttp = "T1055"
references = ["h... | 28.652174 | 126 | 0.597876 |
from plugins.base.attack import AttackPlugin, Requirement
class MetasploitScreengrabPlugin(AttackPlugin):
name = "metasploit_screengrab"
description = "Grab a screenshot"
ttp = "T1055"
references = ["https://attack.mitre.org/techniques/T1055/"]
required_files = []
requirements = [R... | true | true |
f74b6d3b78ca6d294d776870d7952d3a8a53aacc | 1,344 | py | Python | opencensus/stats/stats_recorder.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 650 | 2017-07-09T02:08:10.000Z | 2022-03-22T20:39:54.000Z | opencensus/stats/stats_recorder.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 735 | 2017-07-26T01:15:16.000Z | 2022-03-29T20:17:20.000Z | opencensus/stats/stats_recorder.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 256 | 2017-07-24T18:29:15.000Z | 2022-03-15T15:33:03.000Z | # Copyright 2018, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 38.4 | 78 | 0.760417 |
from opencensus.stats import execution_context
from opencensus.stats.measure_to_view_map import MeasureToViewMap
from opencensus.stats.measurement_map import MeasurementMap
class StatsRecorder(object):
def __init__(self):
if execution_context.get_measure_to_view_map() == {}:
execution_context... | true | true |
f74b6d3f2dee6992c3cfe66625a20766e4ae9a96 | 507 | py | Python | Backend/lib/python3.6/site-packages/flask_mailer/backends/dummy.py | sahilb2/SelfImprovementWebApp | 2ba232c4e150efb4ef41689ed049d29293e2086e | [
"MIT"
] | 1 | 2021-02-24T04:59:03.000Z | 2021-02-24T04:59:03.000Z | Backend/lib/python3.6/site-packages/flask_mailer/backends/dummy.py | sahilb2/SelfImprovementWebApp | 2ba232c4e150efb4ef41689ed049d29293e2086e | [
"MIT"
] | null | null | null | Backend/lib/python3.6/site-packages/flask_mailer/backends/dummy.py | sahilb2/SelfImprovementWebApp | 2ba232c4e150efb4ef41689ed049d29293e2086e | [
"MIT"
] | 1 | 2018-12-09T00:53:21.000Z | 2018-12-09T00:53:21.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from flask_mailer.backends.base import Mailer
class DummyMailer(Mailer):
"""Dummy mailing instance for unittests.
Keeps all sent messages in *oubox* list.
"""
def __init__(self, **kwargs):
self.outbox = []
def send(self, message):
"""Send... | 24.142857 | 54 | 0.625247 | from flask_mailer.backends.base import Mailer
class DummyMailer(Mailer):
def __init__(self, **kwargs):
self.outbox = []
def send(self, message):
self.outbox.append(message)
def send_quiet(self, message):
self.send(message)
| true | true |
f74b6d59181163c788af4b2a384d46492569c9ee | 4,267 | py | Python | backend/coreapp/sandbox.py | decompme/decomp.me | edb33de278e3fcce59422e0cb18582e805fa766c | [
"MIT"
] | 47 | 2021-11-05T14:20:58.000Z | 2022-03-19T18:56:46.000Z | backend/coreapp/sandbox.py | decompme/decomp.me | edb33de278e3fcce59422e0cb18582e805fa766c | [
"MIT"
] | 131 | 2021-10-20T09:17:16.000Z | 2022-03-31T22:22:54.000Z | backend/coreapp/sandbox.py | decompme/decomp.me | edb33de278e3fcce59422e0cb18582e805fa766c | [
"MIT"
] | 20 | 2021-11-23T18:49:45.000Z | 2022-03-29T06:25:10.000Z | import contextlib
import logging
import os
import shlex
import subprocess
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Dict, List, Optional, Union
from django.conf import settings
from coreapp.error import SandboxError
logger = logging.getLogger(__name__)
class Sandbox(contex... | 32.823077 | 84 | 0.561284 | import contextlib
import logging
import os
import shlex
import subprocess
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Dict, List, Optional, Union
from django.conf import settings
from coreapp.error import SandboxError
logger = logging.getLogger(__name__)
class Sandbox(contex... | true | true |
f74b6db7bcc9f8d0932e19fd4b7c8be7a3ca0271 | 872 | py | Python | navio_tasks/pure_reports/cli_gitchangelog.py | matthewdeanmartin/random_names | 5c78a96e62c7924864c7ef802f995eb55d5a520f | [
"MIT"
] | 8 | 2019-05-24T19:31:38.000Z | 2019-05-28T14:13:56.000Z | navio_tasks/pure_reports/cli_gitchangelog.py | matthewdeanmartin/random_names | 5c78a96e62c7924864c7ef802f995eb55d5a520f | [
"MIT"
] | 17 | 2018-07-14T17:04:49.000Z | 2022-03-24T15:59:11.000Z | navio_tasks/pure_reports/cli_gitchangelog.py | matthewdeanmartin/so_pip | 0ff7ab096352ae3dc316606d1acd5582cfaee25a | [
"MIT"
] | 2 | 2021-03-26T18:34:41.000Z | 2022-03-14T16:27:23.000Z | """
Extract commit comments from git to a report. Makes for a lousy CHANGELOG.md
"""
import shlex
from navio_tasks.cli_commands import (
check_command_exists,
config_pythonpath,
execute_get_text,
)
from navio_tasks.settings import VENV_SHELL
from navio_tasks.utils import inform
def do_gitchangelog() -> N... | 30.068966 | 85 | 0.712156 | import shlex
from navio_tasks.cli_commands import (
check_command_exists,
config_pythonpath,
execute_get_text,
)
from navio_tasks.settings import VENV_SHELL
from navio_tasks.utils import inform
def do_gitchangelog() -> None:
command_name = "gitchangelog"
check_command_exists(command_name)
... | true | true |
f74b6e59f2fe312e9f7611c775443e330f635f70 | 14,623 | py | Python | Lib/_markupbase.py | jkamdjou/cpython | 6375163c6745315f94d37a99981c05bff444f720 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/_markupbase.py | jkamdjou/cpython | 6375163c6745315f94d37a99981c05bff444f720 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/_markupbase.py | jkamdjou/cpython | 6375163c6745315f94d37a99981c05bff444f720 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the html.parser module. It has no
documented public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.com... | 36.833753 | 92 | 0.479724 |
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.compile(r'(\'[^\']*\'|"[^"]*")\s*').match
_commentclose = re.compile(r'--\s*>')
_markedsectionclose = re.compile(r']\s*]\s*>')
# An analysis of the MS-Word extensions is available at
# http://www.planetpublish.com/x... | true | true |
f74b705325797d3263bb943daeb46bdb67e49b37 | 3,731 | py | Python | build_docs.py | bitranox/lib_detect_encoding | 95a1325016a645f337943c879ebd34f5a3a630e9 | [
"MIT"
] | null | null | null | build_docs.py | bitranox/lib_detect_encoding | 95a1325016a645f337943c879ebd34f5a3a630e9 | [
"MIT"
] | null | null | null | build_docs.py | bitranox/lib_detect_encoding | 95a1325016a645f337943c879ebd34f5a3a630e9 | [
"MIT"
] | null | null | null | """ Build the README.rst either locally, or on Github for tagged commits.
Usage:
build_docs.py <TRAVIS_REPO_SLUG>
build_docs.py (-h | --help)
The TRAVIS_REPO_SLUG has following Format : "github_username/github_repository"
Options:
-h --help Show this screen
"""
# STDLIB
import datetime
import errno
i... | 35.198113 | 162 | 0.60922 |
import datetime
import errno
import logging
import sys
from typing import Dict
from docopt import docopt
import lib_log_utils import rst_include
codeclimate_link_hash = "7d130ff52f3b507552ad"
def project_specific(repository_slug: str, repository: str, repository_dashed: str) -> No... | true | true |
f74b711d01eec18bff84588a732055b42e890a57 | 21 | py | Python | examples/callable/ex1.py | mcorne/python-by-example | 15339c0909c84b51075587a6a66391100971c033 | [
"MIT"
] | null | null | null | examples/callable/ex1.py | mcorne/python-by-example | 15339c0909c84b51075587a6a66391100971c033 | [
"MIT"
] | null | null | null | examples/callable/ex1.py | mcorne/python-by-example | 15339c0909c84b51075587a6a66391100971c033 | [
"MIT"
] | null | null | null | print(callable(abs))
| 10.5 | 20 | 0.761905 | print(callable(abs))
| true | true |
f74b71825977f9624eb264945993ea19aa293483 | 86 | py | Python | tests/closure.py | lazyxu/pythonvm | 8c25acc6ee1e01a0bb65bb35aae987264d6876aa | [
"MIT"
] | null | null | null | tests/closure.py | lazyxu/pythonvm | 8c25acc6ee1e01a0bb65bb35aae987264d6876aa | [
"MIT"
] | null | null | null | tests/closure.py | lazyxu/pythonvm | 8c25acc6ee1e01a0bb65bb35aae987264d6876aa | [
"MIT"
] | null | null | null | def func():
x = 2
def say():
print x
return say
f = func()
f()
| 7.818182 | 15 | 0.418605 | def func():
x = 2
def say():
print x
return say
f = func()
f()
| false | true |
f74b727bbcd82babe2dac36e1dddbc894fa5cd63 | 1,162 | py | Python | pytorch_gan_metrics/calc_fid_stats.py | w86763777/Pytorch-Unified-FID-IS-Score | 6a2620d6da0faa66bb798aa47c7e0e49ef2032b6 | [
"Apache-2.0"
] | 39 | 2021-06-24T06:09:44.000Z | 2022-03-28T11:57:43.000Z | pytorch_gan_metrics/calc_fid_stats.py | w86763777/Pytorch-Unified-FID-IS-Score | 6a2620d6da0faa66bb798aa47c7e0e49ef2032b6 | [
"Apache-2.0"
] | 2 | 2021-11-18T04:06:09.000Z | 2021-11-19T01:37:24.000Z | pytorch_gan_metrics/calc_fid_stats.py | w86763777/Pytorch-Unified-FID-IS-Score | 6a2620d6da0faa66bb798aa47c7e0e49ef2032b6 | [
"Apache-2.0"
] | 6 | 2021-10-05T01:23:04.000Z | 2021-12-24T05:15:52.000Z | import argparse
import os
import numpy as np
from torch.utils.data import DataLoader
from . import ImageDataset
from .core import get_inception_feature
def calc_and_save_stats(path, output, batch_size):
dataset = ImageDataset(path, exts=['png', 'jpg'])
loader = DataLoader(dataset, batch_size=batch_size, num... | 33.2 | 74 | 0.675559 | import argparse
import os
import numpy as np
from torch.utils.data import DataLoader
from . import ImageDataset
from .core import get_inception_feature
def calc_and_save_stats(path, output, batch_size):
dataset = ImageDataset(path, exts=['png', 'jpg'])
loader = DataLoader(dataset, batch_size=batch_size, num... | true | true |
f74b727bea2b7cb7921276b294d3991a5c008017 | 406 | py | Python | src/prefect/tasks/postgres/__init__.py | BluePoof/prefect | 59dc4eb965ee83bdb1157ee41c9423917d1101ea | [
"Apache-2.0"
] | 1 | 2020-12-07T14:26:50.000Z | 2020-12-07T14:26:50.000Z | src/prefect/tasks/postgres/__init__.py | BluePoof/prefect | 59dc4eb965ee83bdb1157ee41c9423917d1101ea | [
"Apache-2.0"
] | 1 | 2020-05-24T17:04:47.000Z | 2020-05-24T17:04:47.000Z | src/prefect/tasks/postgres/__init__.py | BluePoof/prefect | 59dc4eb965ee83bdb1157ee41c9423917d1101ea | [
"Apache-2.0"
] | null | null | null | """
This module contains a collection of tasks for interacting with Postgres databases via
the psycopg2 library.
"""
try:
from prefect.tasks.postgres.postgres import (
PostgresExecute,
PostgresExecuteMany,
PostgresFetch,
)
except ImportError:
raise ImportError(
'Using `prefe... | 25.375 | 100 | 0.704433 |
try:
from prefect.tasks.postgres.postgres import (
PostgresExecute,
PostgresExecuteMany,
PostgresFetch,
)
except ImportError:
raise ImportError(
'Using `prefect.tasks.postgres` requires Prefect to be installed with the "postgres" extra.'
)
| true | true |
f74b746cfa0beed974e1a973f3f3422ca72fc0c0 | 6,085 | py | Python | tensorflow_probability/python/math/psd_kernels/exponentiated_quadratic.py | NeelGhoshal/probability | 45ed841e3cff6cdc7cd1b2d96dd874d9070318f7 | [
"Apache-2.0"
] | 2 | 2019-10-30T04:45:07.000Z | 2019-10-30T04:45:08.000Z | tensorflow_probability/python/math/psd_kernels/exponentiated_quadratic.py | gregorystrubel/probability | df96f3d56eff92c6b06fbac68dc58e095e28fed6 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/math/psd_kernels/exponentiated_quadratic.py | gregorystrubel/probability | df96f3d56eff92c6b06fbac68dc58e095e28fed6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.771242 | 101 | 0.704519 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.internal import assert_util
from tensorflow_probability.python.internal import tensor_util
from tensorflow_probability.python.math.psd_kern... | true | true |
f74b74b897616a9cea6864cb578a2e988dc25479 | 525 | py | Python | fixationgui/settingsload.py | Eurybiadan/Fixation_GUI | 0387ac9f8eaf7c72ced9d9ebdf0f6ccb30866035 | [
"Apache-2.0"
] | 2 | 2019-04-17T14:14:36.000Z | 2021-01-20T15:20:26.000Z | fixationgui/settingsload.py | Eurybiadan/Fixation_GUI | 0387ac9f8eaf7c72ced9d9ebdf0f6ccb30866035 | [
"Apache-2.0"
] | 19 | 2018-07-23T17:29:35.000Z | 2021-01-14T13:47:25.000Z | fixationgui/settingsload.py | Eurybiadan/Fixation_GUI | 0387ac9f8eaf7c72ced9d9ebdf0f6ccb30866035 | [
"Apache-2.0"
] | null | null | null | import string
try:
f = open('ports.inf','r+')
for line in f:
print line
splitstring=string.split(line, '=')
if splitstring[0] == "ScreenPort":
ScreenPort = splitstring[1].rstrip()
print "Setting screenport to: " + ScreenPort
elif splitstring[0... | 29.166667 | 61 | 0.55619 | import string
try:
f = open('ports.inf','r+')
for line in f:
print line
splitstring=string.split(line, '=')
if splitstring[0] == "ScreenPort":
ScreenPort = splitstring[1].rstrip()
print "Setting screenport to: " + ScreenPort
elif splitstring[0... | false | true |
f74b74c0e567332b00ebed0202ee731f4feca148 | 1,088 | py | Python | InClass&Examples/InClass_20210303.py | jonaswagner2826/MECH6327 | 2b55aaf6f9e1bcf5cc684f5c853cadec26acf9d2 | [
"MIT"
] | null | null | null | InClass&Examples/InClass_20210303.py | jonaswagner2826/MECH6327 | 2b55aaf6f9e1bcf5cc684f5c853cadec26acf9d2 | [
"MIT"
] | null | null | null | InClass&Examples/InClass_20210303.py | jonaswagner2826/MECH6327 | 2b55aaf6f9e1bcf5cc684f5c853cadec26acf9d2 | [
"MIT"
] | null | null | null |
"""
In Class Ex:
Constrained \infty-norm minimization
Problem:
minimize:
\norm{x}_\infty
subject to:
A x \leq b
Notes:
\norm{x}_\infty = \max_i \abs{x_i}
= \max_i \{x_i, -x_i\}
= \max_i \{x_1, \dots, x_n, -x_1, \dots, -x_n\}
Epigraph Form:
mi... | 16.484848 | 67 | 0.52114 |
import cvxpy as cp
import numpy as np
n = 10
m = 100
A = np.random.rand(m, n)
b = np.random.rand(m, 1) - 1
X = cp.Variable((n, n))
prob = cp.Problem(cp.Minimize(cp.max(cp.sum(cp.abs(X)))),
[A @ X <= b])
print("The optimal value is", prob.value)
print("A solution X is")
print(X.value)
| true | true |
f74b75e459f2acec46554a2eb4ee1c0d814b6c3b | 5,096 | py | Python | main/robot.py | edazpotato/usefull-discord-bot | 81b35e73b135afc887033510a635738899793264 | [
"MIT"
] | 2 | 2020-10-16T10:01:18.000Z | 2021-11-15T09:43:34.000Z | main/robot.py | edazpotato/usefull-discord-bot | 81b35e73b135afc887033510a635738899793264 | [
"MIT"
] | null | null | null | main/robot.py | edazpotato/usefull-discord-bot | 81b35e73b135afc887033510a635738899793264 | [
"MIT"
] | null | null | null | import discord
import ksoftapi
import logging
import aiohttp
import os
import json
import datetime
import time
import sys
import asyncpg
from utils import permissions, usefull
from main import context, prefix
from discord.ext import commands
from collections import namedtuple
c = usefull.colors
#AutoShardedClient.sha... | 33.30719 | 194 | 0.700942 | import discord
import ksoftapi
import logging
import aiohttp
import os
import json
import datetime
import time
import sys
import asyncpg
from utils import permissions, usefull
from main import context, prefix
from discord.ext import commands
from collections import namedtuple
c = usefull.colors
class Robot(commands.... | true | true |
f74b76264821b75c12d1670e7027915511805e8f | 13,912 | py | Python | disagreements/disagreement.py | yotamitai/Agent-Disagreements | 858583db448c5621273824527f1f4181ebf55a2b | [
"MIT"
] | null | null | null | disagreements/disagreement.py | yotamitai/Agent-Disagreements | 858583db448c5621273824527f1f4181ebf55a2b | [
"MIT"
] | null | null | null | disagreements/disagreement.py | yotamitai/Agent-Disagreements | 858583db448c5621273824527f1f4181ebf55a2b | [
"MIT"
] | null | null | null | from copy import deepcopy
import cv2
import imageio
import numpy as np
import matplotlib.pyplot as plt
from os.path import join
from PIL import ImageFont, ImageDraw, Image
from disagreements.common.utils import make_clean_dirs, save_image, create_video
from disagreements.logging_info import log
from disagreements.get... | 44.165079 | 98 | 0.660006 | from copy import deepcopy
import cv2
import imageio
import numpy as np
import matplotlib.pyplot as plt
from os.path import join
from PIL import ImageFont, ImageDraw, Image
from disagreements.common.utils import make_clean_dirs, save_image, create_video
from disagreements.logging_info import log
from disagreements.get... | true | true |
f74b76339faa97e22e366928d75995088e8ac18e | 1,447 | py | Python | src/kedro_devops/__init__.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | null | null | null | src/kedro_devops/__init__.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | 8 | 2021-10-20T12:32:37.000Z | 2021-10-20T16:46:17.000Z | src/kedro_devops/__init__.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | 4 | 2021-10-15T13:36:53.000Z | 2021-11-12T16:16:50.000Z | # Copyright 2021 QuantumBlack Visual Analytics Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 48.233333 | 77 | 0.77678 |
__version__ = "0.1"
| true | true |
f74b76876d5f0d7432247b78537a960df71bdd33 | 7,678 | py | Python | wechat_formatter/formats.py | STEMgirlsChina/tools | 47936dbd379b1b8580789e50ae95c9e72b77c9ed | [
"Apache-2.0"
] | null | null | null | wechat_formatter/formats.py | STEMgirlsChina/tools | 47936dbd379b1b8580789e50ae95c9e72b77c9ed | [
"Apache-2.0"
] | 1 | 2015-07-05T15:14:41.000Z | 2015-07-05T15:14:41.000Z | wechat_formatter/formats.py | STEMgirlsChina/tools | 47936dbd379b1b8580789e50ae95c9e72b77c9ed | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
__author__ = 'jsun'
class BaseFormat(object):
def __init__(self):
self.name = "base_format"
self.id = -1
self.description = ""
self.html_pre = ""
self.html_post = ""
self.child_formats = []
self.usep = False
self.useheader = False
c... | 44.900585 | 668 | 0.635582 |
__author__ = 'jsun'
class BaseFormat(object):
def __init__(self):
self.name = "base_format"
self.id = -1
self.description = ""
self.html_pre = ""
self.html_post = ""
self.child_formats = []
self.usep = False
self.useheader = False
class SectionTitl... | true | true |
f74b769e58ff548e6a248d827fcda649e7136a67 | 405 | py | Python | build/android/pylib/perf/test_options.py | iplo/Chain | 8bc8943d66285d5258fffc41bed7c840516c4422 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | build/android/pylib/perf/test_options.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 8 | 2015-08-31T06:39:59.000Z | 2021-12-04T14:53:28.000Z | build/android/pylib/perf/test_options.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defines the PerfOptions named tuple."""
import collections
PerfOptions = collections.namedtuple('PerfOptions', [
'steps',
'flaky_steps',
'pr... | 22.5 | 72 | 0.693827 |
import collections
PerfOptions = collections.namedtuple('PerfOptions', [
'steps',
'flaky_steps',
'print_step',
'no_timeout',
'test_filter',
'dry_run',
'single_step',
])
| true | true |
f74b76a104d2a429f5098d17bffc4e74ab579f88 | 434 | py | Python | Steam Key Safe/venv/Scripts/pip-script.py | baxter5469/steam-key-safe | f9f721fa4776db650956400b1b808f707f07c5c1 | [
"MIT"
] | null | null | null | Steam Key Safe/venv/Scripts/pip-script.py | baxter5469/steam-key-safe | f9f721fa4776db650956400b1b808f707f07c5c1 | [
"MIT"
] | null | null | null | Steam Key Safe/venv/Scripts/pip-script.py | baxter5469/steam-key-safe | f9f721fa4776db650956400b1b808f707f07c5c1 | [
"MIT"
] | null | null | null | #!"C:\Users\IsaacB\Documents\GitHub\steam-key-safe\Steam Key Safe\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip'
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\... | 33.384615 | 90 | 0.668203 | __requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
)
| true | true |
f74b780a628d5d170fc2ace86b317a9903ac4e69 | 581 | py | Python | podcasts/models.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | null | null | null | podcasts/models.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | null | null | null | podcasts/models.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | 1 | 2020-07-03T21:04:34.000Z | 2020-07-03T21:04:34.000Z | from django.db import models
from django.utils import timezone
from autores.models import Autor
class Podcast(models.Model):
titulo = models.CharField(max_length=255)
autor = models.ForeignKey(Autor, on_delete=models.DO_NOTHING)
data = models.DateTimeField(default=timezone.now())
descricao = models.Te... | 32.277778 | 65 | 0.722892 | from django.db import models
from django.utils import timezone
from autores.models import Autor
class Podcast(models.Model):
titulo = models.CharField(max_length=255)
autor = models.ForeignKey(Autor, on_delete=models.DO_NOTHING)
data = models.DateTimeField(default=timezone.now())
descricao = models.Te... | true | true |
f74b7856dbc6047c4de0604367b0229efb740390 | 1,156 | py | Python | src/data_utils.py | mumingpo/590op-final-project | 95851d2f430cdc24b9d834c6a50b069fc637a8ed | [
"MIT"
] | null | null | null | src/data_utils.py | mumingpo/590op-final-project | 95851d2f430cdc24b9d834c6a50b069fc637a8ed | [
"MIT"
] | null | null | null | src/data_utils.py | mumingpo/590op-final-project | 95851d2f430cdc24b9d834c6a50b069fc637a8ed | [
"MIT"
] | null | null | null | import numpy as np
def read_data(path, M, N, offset=0):
"""
Read u.data in the default format.
The memory cost associated with a [943, 1682] matrix of floats are not big,
so we can still do this.
"Might" run into trouble for larger datasets,
where we will need to handle things in batches.
Params:
M:... | 29.641026 | 84 | 0.630623 | import numpy as np
def read_data(path, M, N, offset=0):
arr = np.zeros([M, N], dtype=np.float)
omega = np.full([M, N], False, dtype=np.bool)
with open(path, "rt") as f:
for line in f:
if line == "":
continue
fields = line.split('\t')
if len(fields) != 4:
raise ... | true | true |
f74b7913eedf6a298d0a60d29cd4aca38f07b067 | 1,046 | py | Python | backend/api/__init__.py | Idzikowski-Casey/column-topology | da26b10a1c375f31ff39e75fcb3d3d78d142934d | [
"MIT"
] | null | null | null | backend/api/__init__.py | Idzikowski-Casey/column-topology | da26b10a1c375f31ff39e75fcb3d3d78d142934d | [
"MIT"
] | 4 | 2021-12-06T16:47:09.000Z | 2022-01-03T19:34:24.000Z | backend/api/__init__.py | Idzikowski-Casey/column-topology | da26b10a1c375f31ff39e75fcb3d3d78d142934d | [
"MIT"
] | null | null | null | from starlette.routing import Route
from starlette.applications import Starlette
from starlette.middleware.cors import CORSMiddleware
from starlette.middleware import Middleware
from .home import HomePage
from .column_groups import ColumnGroups
from .project import ProjectsAPI
from .geometries import geometries, get_l... | 40.230769 | 94 | 0.710325 | from starlette.routing import Route
from starlette.applications import Starlette
from starlette.middleware.cors import CORSMiddleware
from starlette.middleware import Middleware
from .home import HomePage
from .column_groups import ColumnGroups
from .project import ProjectsAPI
from .geometries import geometries, get_l... | true | true |
f74b79a0c240c21a8083a044a22caf2c46366a36 | 1,916 | py | Python | configs/activations/cascade_r50_4x4_1x.py | kostas1515/GumbelActivationForLLongTailSegmentation | c97a1f6abe02877518de9c266a366ae0fe07d59a | [
"Apache-2.0"
] | 5 | 2021-11-18T17:12:46.000Z | 2021-12-14T16:19:39.000Z | configs/activations/cascade_r50_4x4_1x.py | kostas1515/GumbelActivationForLongTailSegmentation | c97a1f6abe02877518de9c266a366ae0fe07d59a | [
"Apache-2.0"
] | null | null | null | configs/activations/cascade_r50_4x4_1x.py | kostas1515/GumbelActivationForLongTailSegmentation | c97a1f6abe02877518de9c266a366ae0fe07d59a | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../lvis/cascade_rcnn_r50_fpn_sample1e-3_mstrain_1x_lvis_v1.py'
]
data = dict(train=dict(oversample_thr=0.0))
model = dict(roi_head=dict(bbox_head=[dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=1203,
bbox_coder=dict(
... | 34.214286 | 70 | 0.612213 | _base_ = [
'../../lvis/cascade_rcnn_r50_fpn_sample1e-3_mstrain_1x_lvis_v1.py'
]
data = dict(train=dict(oversample_thr=0.0))
model = dict(roi_head=dict(bbox_head=[dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=1203,
bbox_coder=dict(
... | true | true |
f74b79b82e1937b79a48e1b43ed66167b97acb17 | 41,245 | py | Python | src/olympia/amo/tests/__init__.py | siddhi523/addons-server | 36ff76a25070c4ef8504837131906a9f2aa8d86a | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/tests/__init__.py | siddhi523/addons-server | 36ff76a25070c4ef8504837131906a9f2aa8d86a | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/tests/__init__.py | siddhi523/addons-server | 36ff76a25070c4ef8504837131906a9f2aa8d86a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import random
import shutil
import socket
import struct
import time
import uuid
from contextlib import contextmanager
from datetime import datetime, timedelta
from functools import partial
from importlib import import_module
from urllib.parse import parse_qs, urlparse
from unittest imp... | 34.983036 | 111 | 0.654964 | import os
import random
import shutil
import socket
import struct
import time
import uuid
from contextlib import contextmanager
from datetime import datetime, timedelta
from functools import partial
from importlib import import_module
from urllib.parse import parse_qs, urlparse
from unittest import mock
from tempfile i... | true | true |
f74b7aefb5c8e941ee78626ce8e15a8860d642cf | 711 | py | Python | addons/account/wizard/account_validate_account_move.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/account/wizard/account_validate_account_move.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/account/wizard/account_validate_account_move.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | from odoo import models, api, _
from odoo.exceptions import UserError
class ValidateAccountMove(models.TransientModel):
_name = "validate.account.move"
_description = "Validate Account Move"
@api.multi
def validate_move(self):
context = dict(self._context or {})
moves = self.env['acco... | 33.857143 | 83 | 0.64135 | from odoo import models, api, _
from odoo.exceptions import UserError
class ValidateAccountMove(models.TransientModel):
_name = "validate.account.move"
_description = "Validate Account Move"
@api.multi
def validate_move(self):
context = dict(self._context or {})
moves = self.env['acco... | true | true |
f74b7c4b8851a51fdc2b5af5003f85b3b0f485de | 707 | py | Python | lang/py/pylib/code/subprocess/subprocess_pipes.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 13 | 2020-01-04T07:37:38.000Z | 2021-08-31T05:19:58.000Z | lang/py/pylib/code/subprocess/subprocess_pipes.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 3 | 2020-06-05T22:42:53.000Z | 2020-08-24T07:18:54.000Z | lang/py/pylib/code/subprocess/subprocess_pipes.py | ch1huizong/learning | 632267634a9fd84a5f5116de09ff1e2681a6cc85 | [
"MIT"
] | 9 | 2020-10-19T04:53:06.000Z | 2021-08-31T05:20:01.000Z | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
#end_pymotw_header
import subprocess
cat = subprocess.Popen(['cat', 'index.rst'],
stdout=subprocess.PIPE,
)
grep = subprocess.Popen(['grep', '.. include::'],
... | 22.806452 | 55 | 0.492221 | """
"""
import subprocess
cat = subprocess.Popen(['cat', 'index.rst'],
stdout=subprocess.PIPE,
)
grep = subprocess.Popen(['grep', '.. include::'],
stdin=cat.stdout,
stdout=subprocess.PIPE,
)
cut ... | false | true |
f74b7d25b7df72482aee056c1dc499900e5c69d7 | 738 | py | Python | tests/mocker/upgrade_workers/error_worker.py | lihaiyong827/python-openimu | f1c536ba4182aaeabd87b63c08ebd92f97e8dbb4 | [
"Apache-2.0"
] | 41 | 2018-07-20T17:30:33.000Z | 2022-02-24T08:17:39.000Z | tests/mocker/upgrade_workers/error_worker.py | lihaiyong827/python-openimu | f1c536ba4182aaeabd87b63c08ebd92f97e8dbb4 | [
"Apache-2.0"
] | 52 | 2018-06-25T22:15:14.000Z | 2022-03-10T07:30:56.000Z | tests/mocker/upgrade_workers/error_worker.py | lihaiyong827/python-openimu | f1c536ba4182aaeabd87b63c08ebd92f97e8dbb4 | [
"Apache-2.0"
] | 31 | 2018-12-19T00:10:08.000Z | 2022-03-19T02:14:03.000Z | from aceinna.devices.base import UpgradeWorkerBase
class ErrorWorker(UpgradeWorkerBase):
def __init__(self):
super(ErrorWorker, self).__init__()
self._total = 1024*1024 # 1M size
def get_upgrade_content_size(self):
return self._total
def work(self):
current = 0
s... | 25.448276 | 66 | 0.577236 | from aceinna.devices.base import UpgradeWorkerBase
class ErrorWorker(UpgradeWorkerBase):
def __init__(self):
super(ErrorWorker, self).__init__()
self._total = 1024*1024
def get_upgrade_content_size(self):
return self._total
def work(self):
current = 0
step = 200
... | true | true |
f74b7d8bdd3359e63e7a660bdddcf7d39cf73a1e | 14,752 | py | Python | grakel/kernels/kernel.py | Alessi0X/GraKeL | 222fcdde4071afebeb3d7bd724b1f979ede8df7f | [
"BSD-3-Clause"
] | null | null | null | grakel/kernels/kernel.py | Alessi0X/GraKeL | 222fcdde4071afebeb3d7bd724b1f979ede8df7f | [
"BSD-3-Clause"
] | null | null | null | grakel/kernels/kernel.py | Alessi0X/GraKeL | 222fcdde4071afebeb3d7bd724b1f979ede8df7f | [
"BSD-3-Clause"
] | null | null | null | """The main class file representing a kernel."""
# Author: Ioannis Siglidis <y.siglidis@gmail.com>
# License: BSD 3 clause
import collections
import warnings
import copy
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
from sklearn.exceptions import NotFittedError
fr... | 34.629108 | 100 | 0.564466 | import collections
import warnings
import copy
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
from sklearn.exceptions import NotFittedError
from sklearn.utils.validation import check_is_fitted
from sklearn.externals import joblib
from grakel.graph import Graph
fro... | true | true |
f74b7e44a3b8656f186f8930530770ad7bef80e6 | 64,587 | py | Python | conans/test/unittests/client/build/cmake_test.py | akemimadoka/conan | 272be061082ddf73f1f5d71bf98f50273d7f3cba | [
"MIT"
] | null | null | null | conans/test/unittests/client/build/cmake_test.py | akemimadoka/conan | 272be061082ddf73f1f5d71bf98f50273d7f3cba | [
"MIT"
] | null | null | null | conans/test/unittests/client/build/cmake_test.py | akemimadoka/conan | 272be061082ddf73f1f5d71bf98f50273d7f3cba | [
"MIT"
] | null | null | null | import os
import platform
import shutil
import stat
import sys
import unittest
import mock
import six
from parameterized.parameterized import parameterized
from conans.client import tools
from conans.client.build.cmake import CMake
from conans.client.build.cmake_flags import cmake_in_local_cache_var_name
from conans.... | 44.820958 | 101 | 0.588416 | import os
import platform
import shutil
import stat
import sys
import unittest
import mock
import six
from parameterized.parameterized import parameterized
from conans.client import tools
from conans.client.build.cmake import CMake
from conans.client.build.cmake_flags import cmake_in_local_cache_var_name
from conans.... | true | true |
f74b7e8a3f2617ff3221d387fc11642c755c9911 | 1,375 | py | Python | examples/onedrive/import_files.py | andreas-j-hauser/Office365-REST-Python-Client | 4bf8ee0b65985980b50fc3b74b32fd2db34561ba | [
"MIT"
] | null | null | null | examples/onedrive/import_files.py | andreas-j-hauser/Office365-REST-Python-Client | 4bf8ee0b65985980b50fc3b74b32fd2db34561ba | [
"MIT"
] | null | null | null | examples/onedrive/import_files.py | andreas-j-hauser/Office365-REST-Python-Client | 4bf8ee0b65985980b50fc3b74b32fd2db34561ba | [
"MIT"
] | null | null | null | import os
from os.path import isfile, join
import adal
from settings import settings
from office365.graph_client import GraphClient
def get_token():
"""Acquire token via client credential flow
"""
authority_url = 'https://login.microsoftonline.com/{0}'.format(settings['tenant'])
auth_ctx = adal.Auth... | 31.25 | 93 | 0.705455 | import os
from os.path import isfile, join
import adal
from settings import settings
from office365.graph_client import GraphClient
def get_token():
authority_url = 'https://login.microsoftonline.com/{0}'.format(settings['tenant'])
auth_ctx = adal.AuthenticationContext(authority_url)
token = auth_ctx.ac... | true | true |
f74b7f5ce34cab20dbc06453c8fd0761ad5cd3c5 | 6,705 | py | Python | LYDIAN/lydian/traffic/task.py | AJBenjumea/distributed-apps-platform | 3a4e01099659622b5d7ec1cd0772c1ed309534dd | [
"BSD-2-Clause"
] | 8 | 2021-08-09T03:42:25.000Z | 2022-03-22T15:40:13.000Z | LYDIAN/lydian/traffic/task.py | AJBenjumea/distributed-apps-platform | 3a4e01099659622b5d7ec1cd0772c1ed309534dd | [
"BSD-2-Clause"
] | 2 | 2021-08-05T15:05:47.000Z | 2021-08-09T18:20:23.000Z | LYDIAN/lydian/traffic/task.py | AJBenjumea/distributed-apps-platform | 3a4e01099659622b5d7ec1cd0772c1ed309534dd | [
"BSD-2-Clause"
] | 19 | 2021-07-13T02:28:18.000Z | 2022-03-23T03:57:39.000Z | #!/usr/bin/env python
# Copyright (c) 2020-2021 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2 License
# The full license information can be found in LICENSE.txt
# in the root directory of this project.
import logging
import os
import queue
import threading
from lydian.apps import config as config... | 32.08134 | 77 | 0.61223 |
import logging
import os
import queue
import threading
from lydian.apps import config as config
from lydian.traffic.core import TrafficRecord
from lydian.traffic.client import TCPClient, UDPClient, HTTPClient
from lydian.traffic.server import TCPServer, UDPServer, HTTPServer
from lydian.utils.common import is_ipv6_ad... | true | true |
f74b7fe189d63be3f9241fc1c4b06e4682fffcce | 1,861 | py | Python | data_preprocess.py | atharvamh/Predicting-IDC-in-Breast-Cancer | b9b4dff53256042947749c0ad0ba0536e9984a5a | [
"MIT"
] | null | null | null | data_preprocess.py | atharvamh/Predicting-IDC-in-Breast-Cancer | b9b4dff53256042947749c0ad0ba0536e9984a5a | [
"MIT"
] | null | null | null | data_preprocess.py | atharvamh/Predicting-IDC-in-Breast-Cancer | b9b4dff53256042947749c0ad0ba0536e9984a5a | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
import cv2
import matplotlib.pyplot as plt
import fnmatch
from sklearn.model_selection import train_test_split
from glob import glob
imagePatches = glob('./IDC_regular_ps50_idx5/**/*.png',recursive = True)
def multiplot():
plt.rcParams['figure.figsize'] = (10.0, 10.... | 25.493151 | 81 | 0.679742 | import os
import numpy as np
import pandas as pd
import cv2
import matplotlib.pyplot as plt
import fnmatch
from sklearn.model_selection import train_test_split
from glob import glob
imagePatches = glob('./IDC_regular_ps50_idx5/**/*.png',recursive = True)
def multiplot():
plt.rcParams['figure.figsize'] = (10.0, 10.... | true | true |
f74b809977f75926bc57ff9c2d3663d1e6038e1a | 5,602 | py | Python | tests/toranj/test-002-form.py | tpmanley/openthread | bc02c6c05cf52884bc6cd9fad8dc8fc16364a147 | [
"BSD-3-Clause"
] | null | null | null | tests/toranj/test-002-form.py | tpmanley/openthread | bc02c6c05cf52884bc6cd9fad8dc8fc16364a147 | [
"BSD-3-Clause"
] | 2 | 2019-02-25T10:21:34.000Z | 2022-01-23T13:05:08.000Z | tests/toranj/test-002-form.py | tpmanley/openthread | bc02c6c05cf52884bc6cd9fad8dc8fc16364a147 | [
"BSD-3-Clause"
] | 1 | 2020-10-22T16:33:36.000Z | 2020-10-22T16:33:36.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 38.108844 | 121 | 0.673152 |
from wpan import verify
import wpan
test_name = __file__[:-3] if __file__.endswith('.py') else __file__
print('-' * 120)
print('Starting \'{}\''.format(test_name))
speedup = 4
wpan.Node.set_time_speedup_factor(speedup)
node = wpan.Node()
wpan.Node.init_all_nodes()
DEFAULT_KEY = '[00112233445566778899AABBCCDDE... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.