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
f778fbadcea8d3219c57afefc4487fbdcaab5c2b
2,876
py
Python
lib/rucio/client/client.py
nataliaratnikova/rucio
4c7789bb9cdb824cc90b91fa0b66acf1b0fac128
[ "Apache-2.0" ]
1
2018-02-27T08:03:41.000Z
2018-02-27T08:03:41.000Z
lib/rucio/client/client.py
greed2411/rucio
3e9a50ce1c3b062a0d048e7aa125ca8ce36fe78e
[ "Apache-2.0" ]
null
null
null
lib/rucio/client/client.py
greed2411/rucio
3e9a50ce1c3b062a0d048e7aa125ca8ce36fe78e
[ "Apache-2.0" ]
null
null
null
# Copyright 2012-2018 CERN for the benefit of the ATLAS collaboration. # # 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...
48.745763
193
0.771558
from rucio.client.accountclient import AccountClient from rucio.client.accountlimitclient import AccountLimitClient from rucio.client.didclient import DIDClient from rucio.client.lockclient import LockClient from rucio.client.metaclient import MetaClient from rucio.client.pingclient import PingClient from rucio.clien...
true
true
f778fe4656ef4449e690a60c4c7b436bd10966e0
3,999
py
Python
python3/koans/about_multiple_inheritance.py
IamRaviTejaG/python-koans-complete
18e9915a53963b374a14b390bd2a33431911e974
[ "MIT" ]
null
null
null
python3/koans/about_multiple_inheritance.py
IamRaviTejaG/python-koans-complete
18e9915a53963b374a14b390bd2a33431911e974
[ "MIT" ]
null
null
null
python3/koans/about_multiple_inheritance.py
IamRaviTejaG/python-koans-complete
18e9915a53963b374a14b390bd2a33431911e974
[ "MIT" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Slightly based on AboutModules in the Ruby Koans # from runner.koan import * class AboutMultipleInheritance(Koan): class Nameable: def __init__(self): self._name = None def set_name(self, new_name): self._name = new_name ...
28.361702
84
0.575394
from runner.koan import * class AboutMultipleInheritance(Koan): class Nameable: def __init__(self): self._name = None def set_name(self, new_name): self._name = new_name def here(self): return "In Nameable class" class Animal: def legs(se...
true
true
f778fea544c79baa6bfbb92fc8fa4eaa2022f123
3,622
py
Python
anmichelpers/comparison/comparison.py
victor-gil-sepulveda/PhD-ANMPythonHelpers
c0e15684cce4aa4da90141b51f043a567a5f8655
[ "MIT" ]
1
2017-11-01T15:19:10.000Z
2017-11-01T15:19:10.000Z
anmichelpers/comparison/comparison.py
victor-gil-sepulveda/PhD-ANMPythonHelpers
c0e15684cce4aa4da90141b51f043a567a5f8655
[ "MIT" ]
null
null
null
anmichelpers/comparison/comparison.py
victor-gil-sepulveda/PhD-ANMPythonHelpers
c0e15684cce4aa4da90141b51f043a567a5f8655
[ "MIT" ]
null
null
null
import numpy import anmichelpers.tools.tools as tools import math from anmichelpers.tools.tools import norm from math import exp # For all measures see http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2350220/ def overlap(mode_i, mode_j): """ Measure of the similarity between 2 modes. Overlap value is in the r...
38.946237
132
0.686361
import numpy import anmichelpers.tools.tools as tools import math from anmichelpers.tools.tools import norm from math import exp def overlap(mode_i, mode_j): return numpy.abs(numpy.dot(mode_i, mode_j)) / (tools.norm(mode_i) * tools.norm(mode_j)) def cumulative_overlap(mode, mode_range): cum_overlap = 0 f...
true
true
f778ff16fd7fcc4bc77af503d21949881ec7b7e7
6,944
py
Python
modules/implant/gather/hashdump_sam.py
jmage-rs/koadic
c6bd03db860dc1230071b7c63dc054a79b1f2607
[ "Apache-2.0" ]
null
null
null
modules/implant/gather/hashdump_sam.py
jmage-rs/koadic
c6bd03db860dc1230071b7c63dc054a79b1f2607
[ "Apache-2.0" ]
null
null
null
modules/implant/gather/hashdump_sam.py
jmage-rs/koadic
c6bd03db860dc1230071b7c63dc054a79b1f2607
[ "Apache-2.0" ]
null
null
null
import core.implant class HashDumpSAMImplant(core.implant.Implant): NAME = "SAM Hash Dump" DESCRIPTION = "Dumps the SAM hive off the target system." AUTHORS = ["zerosum0x0"] def load(self): self.options.register("LPATH", "/tmp/", "local file save path") self.options.register("RPATH", ...
37.945355
151
0.564948
import core.implant class HashDumpSAMImplant(core.implant.Implant): NAME = "SAM Hash Dump" DESCRIPTION = "Dumps the SAM hive off the target system." AUTHORS = ["zerosum0x0"] def load(self): self.options.register("LPATH", "/tmp/", "local file save path") self.options.register("RPATH", ...
true
true
f778ff9d2f91c90fe84c87fd54cb323cbf01fef1
465
py
Python
pollen_measurement_app/pollen_measurement/urls.py
limak360/PollenMeasurement
87445870301e720d9393435cbf3ecaee09d94ad9
[ "MIT" ]
null
null
null
pollen_measurement_app/pollen_measurement/urls.py
limak360/PollenMeasurement
87445870301e720d9393435cbf3ecaee09d94ad9
[ "MIT" ]
null
null
null
pollen_measurement_app/pollen_measurement/urls.py
limak360/PollenMeasurement
87445870301e720d9393435cbf3ecaee09d94ad9
[ "MIT" ]
null
null
null
from django.urls import path from .views import pollen_measurement_form, pollen_measurement_delete, pollen_measurement_list urlpatterns = [ path('', pollen_measurement_form, name='pollen_measurement_insert'), path('<int:id>/', pollen_measurement_form, name='pollen_measurement_update'), path('delete/<int:i...
42.272727
94
0.784946
from django.urls import path from .views import pollen_measurement_form, pollen_measurement_delete, pollen_measurement_list urlpatterns = [ path('', pollen_measurement_form, name='pollen_measurement_insert'), path('<int:id>/', pollen_measurement_form, name='pollen_measurement_update'), path('delete/<int:i...
true
true
f7790057c1645b956c14e1a5e125041468e9e5d3
7,774
py
Python
qcodes/instrument_drivers/Keysight/Keysight_E8267D.py
qnl/Qcodes
ea2c5188f04828c6a76c9cfd9a66509277d7c09f
[ "MIT" ]
null
null
null
qcodes/instrument_drivers/Keysight/Keysight_E8267D.py
qnl/Qcodes
ea2c5188f04828c6a76c9cfd9a66509277d7c09f
[ "MIT" ]
null
null
null
qcodes/instrument_drivers/Keysight/Keysight_E8267D.py
qnl/Qcodes
ea2c5188f04828c6a76c9cfd9a66509277d7c09f
[ "MIT" ]
1
2020-05-03T22:47:40.000Z
2020-05-03T22:47:40.000Z
import numpy as np from qcodes import VisaInstrument, validators as vals from qcodes.utils.validators import Numbers from qcodes.utils.helpers import create_on_off_val_mapping from qcodes.utils.deprecate import deprecate_moved_to_qcd def parse_on_off(stat): if stat.startswith('0'): stat = 'Off' elif s...
48.285714
228
0.589401
import numpy as np from qcodes import VisaInstrument, validators as vals from qcodes.utils.validators import Numbers from qcodes.utils.helpers import create_on_off_val_mapping from qcodes.utils.deprecate import deprecate_moved_to_qcd def parse_on_off(stat): if stat.startswith('0'): stat = 'Off' elif s...
true
true
f779010470f7355adccede511b3584f5044d87f1
1,316
py
Python
python/testData/inspections/PyTypeCheckerInspection/TupleLiteralAgainstTypingLiteral.py
06needhamt/intellij-community
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
[ "Apache-2.0" ]
null
null
null
python/testData/inspections/PyTypeCheckerInspection/TupleLiteralAgainstTypingLiteral.py
06needhamt/intellij-community
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
[ "Apache-2.0" ]
null
null
null
python/testData/inspections/PyTypeCheckerInspection/TupleLiteralAgainstTypingLiteral.py
06needhamt/intellij-community
63d7b8030e4fdefeb4760e511e289f7e6b3a5c5b
[ "Apache-2.0" ]
null
null
null
from typing import Literal, Tuple, List, Set L1 = Literal['test'] L2 = Literal['a', 'b', 5] tuple_one_literal: Tuple[L1] = ('test',) tuple_one_literal_incorrect: Tuple[L1] = <warning descr="Expected type 'tuple[Literal['test']]', got 'tuple[Literal['t']]' instead">('t',)</warning> tuple_union_literal: Tuple[L2] = ('...
62.666667
377
0.645137
from typing import Literal, Tuple, List, Set L1 = Literal['test'] L2 = Literal['a', 'b', 5] tuple_one_literal: Tuple[L1] = ('test',) tuple_one_literal_incorrect: Tuple[L1] = <warning descr="Expected type 'tuple[Literal['test']]', got 'tuple[Literal['t']]' instead">('t',)</warning> tuple_union_literal: Tuple[L2] = ('...
false
true
f77902f70e073bbac49558835806c7d60ab9c0b7
3,034
py
Python
models/phase3_eval/assemble_models.py
jmuhlich/indra
feab2c08541ea73f328579faa6a21b08082cb026
[ "BSD-2-Clause" ]
null
null
null
models/phase3_eval/assemble_models.py
jmuhlich/indra
feab2c08541ea73f328579faa6a21b08082cb026
[ "BSD-2-Clause" ]
null
null
null
models/phase3_eval/assemble_models.py
jmuhlich/indra
feab2c08541ea73f328579faa6a21b08082cb026
[ "BSD-2-Clause" ]
null
null
null
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import pickle from os.path import join as pjoin from indra.tools import assemble_corpus as ac from indra.tools.gene_network import GeneNetwork import process_data, process_r3, process_sparser, process_trips from rea...
40.453333
81
0.686552
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str import pickle from os.path import join as pjoin from indra.tools import assemble_corpus as ac from indra.tools.gene_network import GeneNetwork import process_data, process_r3, process_sparser, process_trips from rea...
true
true
f77903862b845abc4763ca3daa292f64f54b8b9a
365
py
Python
Web_Development_Python/RealPython/sql/07_sql.py
nitin-cherian/LifeLongLearning
84084792058358365162c645742c70064a2d5fd6
[ "MIT" ]
4
2018-01-19T17:15:06.000Z
2018-01-24T00:06:42.000Z
Web_Development_Python/RealPython/sql/07_sql.py
nitin-cherian/LifeLongLearning
84084792058358365162c645742c70064a2d5fd6
[ "MIT" ]
null
null
null
Web_Development_Python/RealPython/sql/07_sql.py
nitin-cherian/LifeLongLearning
84084792058358365162c645742c70064a2d5fd6
[ "MIT" ]
null
null
null
# SELECT statement, remove unicode characters import sqlite3 with sqlite3.connect("new.db") as connection: cursor = connection.cursor() cursor.execute("SELECT firstname, lastname FROM employees") rows_iter = iter(cursor.fetchall()) # fetchall gives a list of tuples for firstname, lastname in row...
20.277778
74
0.720548
import sqlite3 with sqlite3.connect("new.db") as connection: cursor = connection.cursor() cursor.execute("SELECT firstname, lastname FROM employees") rows_iter = iter(cursor.fetchall()) for firstname, lastname in rows_iter: print(firstname, lastname)
true
true
f77903a34c901c906c0b8fcce08fbc4cd12391b4
2,547
py
Python
tests/asm/test_clouds.py
FantasqueX/censys-python
7969206dd3e80cc5eac4df8fd2cb65440f387e37
[ "Apache-2.0" ]
1
2022-03-25T06:22:08.000Z
2022-03-25T06:22:08.000Z
tests/asm/test_clouds.py
FantasqueX/censys-python
7969206dd3e80cc5eac4df8fd2cb65440f387e37
[ "Apache-2.0" ]
null
null
null
tests/asm/test_clouds.py
FantasqueX/censys-python
7969206dd3e80cc5eac4df8fd2cb65440f387e37
[ "Apache-2.0" ]
null
null
null
import datetime import responses from parameterized import parameterized from ..utils import CensysTestCase from .utils import V1_URL from censys.asm.client import AsmClient from censys.asm.clouds import format_since_date TEST_COUNT_JSON = { "totalAssetCount": 0, "totalNewAssetCount": 0, "totalCloudAsset...
27.989011
74
0.604633
import datetime import responses from parameterized import parameterized from ..utils import CensysTestCase from .utils import V1_URL from censys.asm.client import AsmClient from censys.asm.clouds import format_since_date TEST_COUNT_JSON = { "totalAssetCount": 0, "totalNewAssetCount": 0, "totalCloudAsset...
true
true
f7790415db43dd1a88ef3314716317c68a62769f
42,892
py
Python
django/db/backends/oracle/base.py
xavfernandez/django
daaeb8415823444a9020460cf825efc3fae866a2
[ "BSD-3-Clause" ]
2
2016-07-23T18:08:37.000Z
2016-07-24T09:54:34.000Z
django/db/backends/oracle/base.py
xavfernandez/django
daaeb8415823444a9020460cf825efc3fae866a2
[ "BSD-3-Clause" ]
null
null
null
django/db/backends/oracle/base.py
xavfernandez/django
daaeb8415823444a9020460cf825efc3fae866a2
[ "BSD-3-Clause" ]
null
null
null
""" Oracle database backend for Django. Requires cx_Oracle: http://cx-oracle.sourceforge.net/ """ from __future__ import unicode_literals import datetime import decimal import re import platform import sys import warnings def _setup_environment(environ): # Cygwin requires some special voodoo to set the environm...
41.044976
126
0.621934
from __future__ import unicode_literals import datetime import decimal import re import platform import sys import warnings def _setup_environment(environ): if platform.system().upper().startswith('CYGWIN'): try: import ctypes except ImportError as e: from django.c...
true
true
f77905aa2c0892e3de93a157ebc6f1f62ce739ba
592
py
Python
python/apogee/tests/test_main.py
dnidever/apogee
83ad7496a0b4193df9e2c01b06dc36cb879ea6c1
[ "BSD-3-Clause" ]
5
2019-04-11T13:35:24.000Z
2019-11-14T06:12:51.000Z
python/apogee/tests/test_main.py
dnidever/apogee
83ad7496a0b4193df9e2c01b06dc36cb879ea6c1
[ "BSD-3-Clause" ]
null
null
null
python/apogee/tests/test_main.py
dnidever/apogee
83ad7496a0b4193df9e2c01b06dc36cb879ea6c1
[ "BSD-3-Clause" ]
5
2018-09-20T22:07:43.000Z
2021-01-15T07:13:38.000Z
# encoding: utf-8 # # main.py from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from pytest import mark from apogee.main import math class TestMath(object): """Tests for the ``math`` function in main.py.""" ...
24.666667
89
0.641892
from __future__ import division from __future__ import print_function from __future__ import absolute_import from __future__ import unicode_literals from pytest import mark from apogee.main import math class TestMath(object): @mark.parametrize(('arg1', 'arg2', 'operator', 'result'), [(1...
true
true
f7790639193c117bc43e31b2e251b6a604975e72
21,911
py
Python
venv/Lib/site-packages/selenium/webdriver/common/devtools/v101/accessibility.py
ianmota/WebScrappingBimCollab
8101f20fab162c92dac822370bc2b1d9af8ea860
[ "MIT" ]
null
null
null
venv/Lib/site-packages/selenium/webdriver/common/devtools/v101/accessibility.py
ianmota/WebScrappingBimCollab
8101f20fab162c92dac822370bc2b1d9af8ea860
[ "MIT" ]
null
null
null
venv/Lib/site-packages/selenium/webdriver/common/devtools/v101/accessibility.py
ianmota/WebScrappingBimCollab
8101f20fab162c92dac822370bc2b1d9af8ea860
[ "MIT" ]
null
null
null
# DO NOT EDIT THIS FILE! # # This file is generated from the CDP specification. If you need to make # changes, edit the generator and regenerate all of the modules. # # CDP domain: Accessibility (experimental) from __future__ import annotations from .util import event_class, T_JSON_DICT from dataclasses import dataclas...
34.182527
146
0.656154
from __future__ import annotations from .util import event_class, T_JSON_DICT from dataclasses import dataclass import enum import typing from . import dom from . import page from . import runtime class AXNodeId(str): def to_json(self) -> str: return self @classmethod def from_json(cls, json: str...
true
true
f779093f7262410251d8511567a2986ca10b0d13
3,676
py
Python
src/CornerCreator.py
1alexandra/collage
671ca1713d8e9f74faae9e824552a03c253adad0
[ "MIT" ]
1
2020-07-21T12:10:58.000Z
2020-07-21T12:10:58.000Z
src/CornerCreator.py
1alexandra/collage
671ca1713d8e9f74faae9e824552a03c253adad0
[ "MIT" ]
17
2020-03-14T20:27:09.000Z
2022-01-13T02:31:39.000Z
src/CornerCreator.py
1alexandra/collage
671ca1713d8e9f74faae9e824552a03c253adad0
[ "MIT" ]
null
null
null
import numpy as np from PIL import Image, ImageFilter class CornerCreator: """Create corners with a given curvature from ``0`` to ``1``. Corners size is defined by ``corner_width``. Type of corners are defined by ``corner_curvature``: - ``0``: no corners, - from ``0`` to ``0.5``: hyperbolic conv...
28.71875
79
0.518226
import numpy as np from PIL import Image, ImageFilter class CornerCreator: def __init__(self, corner_width, corner_curvature): self.Width = corner_width self.Curve = corner_curvature Width = property(doc="Defines corner size (``Width x Width``).") Curve = property(doc="Corner curvature fr...
true
true
f779097019a9f8cb3c7f2aa89b43a983d381f7fb
3,902
py
Python
nova/objects/compute_node.py
bopopescu/nova_audit
1cd2901802f82d39411adfa04cf2f432ff3bf280
[ "Apache-2.0" ]
1
2020-02-21T19:19:11.000Z
2020-02-21T19:19:11.000Z
nova/objects/compute_node.py
bopopescu/nova_audit
1cd2901802f82d39411adfa04cf2f432ff3bf280
[ "Apache-2.0" ]
null
null
null
nova/objects/compute_node.py
bopopescu/nova_audit
1cd2901802f82d39411adfa04cf2f432ff3bf280
[ "Apache-2.0" ]
1
2020-07-24T09:15:58.000Z
2020-07-24T09:15:58.000Z
# Copyright 2013 IBM Corp. # # 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 agree...
37.161905
78
0.648642
from nova import db from nova.objects import base from nova.objects import utils class ComputeNode(base.NovaPersistentObject, base.NovaObject): VERSION = '1.2' fields = { 'id': int, 'service_id': int, 'vcpus': int, 'memory_mb': int, 'local_gb': int, ...
true
true
f779097da0a1f8c2c8d4989af724583af4ade853
2,399
py
Python
gui/main_window/docks/weight_visualization/image_canvas.py
anglebinbin/Barista-tool
2d51507fb3566881923f0b273127f59d23ed317f
[ "MIT" ]
1
2020-02-11T19:05:17.000Z
2020-02-11T19:05:17.000Z
gui/main_window/docks/weight_visualization/image_canvas.py
anglebinbin/Barista-tool
2d51507fb3566881923f0b273127f59d23ed317f
[ "MIT" ]
null
null
null
gui/main_window/docks/weight_visualization/image_canvas.py
anglebinbin/Barista-tool
2d51507fb3566881923f0b273127f59d23ed317f
[ "MIT" ]
null
null
null
from PyQt5.QtWidgets import ( QGraphicsView, QGraphicsScene, QGraphicsPixmapItem ) from PyQt5 import QtCore from PyQt5.QtGui import QPixmap, QImage, QColor class ImageCanvas(QGraphicsView): """ This class manages the view of the weights. """ def __init__(self): QGraphicsView.__init__(self) ...
38.693548
104
0.656107
from PyQt5.QtWidgets import ( QGraphicsView, QGraphicsScene, QGraphicsPixmapItem ) from PyQt5 import QtCore from PyQt5.QtGui import QPixmap, QImage, QColor class ImageCanvas(QGraphicsView): def __init__(self): QGraphicsView.__init__(self) self.__scene = QGraphicsScene(self) self...
true
true
f7790a2bc3d477aba55345a8d392c55c8b611162
547
py
Python
actions/filter_cli.py
EncoreTechnologies/stackstorm-arista
a9fa03fb94f461de67706653566b4565f48a2dbf
[ "Apache-2.0" ]
null
null
null
actions/filter_cli.py
EncoreTechnologies/stackstorm-arista
a9fa03fb94f461de67706653566b4565f48a2dbf
[ "Apache-2.0" ]
null
null
null
actions/filter_cli.py
EncoreTechnologies/stackstorm-arista
a9fa03fb94f461de67706653566b4565f48a2dbf
[ "Apache-2.0" ]
null
null
null
from st2common.runners.base_action import Action import json class FilterCli(Action): def run(self, cli_result, command, hosts, raw): results = [] for idx, r in enumerate(cli_result): if command in r: output = r[command].replace('\\n', '\n') if not raw:...
30.388889
56
0.49543
from st2common.runners.base_action import Action import json class FilterCli(Action): def run(self, cli_result, command, hosts, raw): results = [] for idx, r in enumerate(cli_result): if command in r: output = r[command].replace('\\n', '\n') if not raw:...
true
true
f7790b473bfdee09959e816208ae48f4b915ca97
5,465
py
Python
Adafruit_MotorHAT/Adafruit_I2C.py
3DRPP/printer
7826c7c82a5331d916d8ea038bd3a44aff6e35b5
[ "MIT" ]
null
null
null
Adafruit_MotorHAT/Adafruit_I2C.py
3DRPP/printer
7826c7c82a5331d916d8ea038bd3a44aff6e35b5
[ "MIT" ]
null
null
null
Adafruit_MotorHAT/Adafruit_I2C.py
3DRPP/printer
7826c7c82a5331d916d8ea038bd3a44aff6e35b5
[ "MIT" ]
null
null
null
#!/usr/bin/python import re import smbus # =========================================================================== # Adafruit_I2C Class # =========================================================================== class Adafruit_I2C(object): @staticmethod def getPiRevision(): "Gets the version number of ...
33.734568
106
0.617383
import re import smbus class Adafruit_I2C(object): @staticmethod def getPiRevision(): try: with open('/proc/cpuinfo', 'r') as infile: for line in infile: match = re.match('Revision\s+:\s+.*(\w{4})$', line) if match and match.group(1) in ['0000', '0002...
true
true
f7790b74515ec3f920cfe4f92470c8f0aa4ea405
973
py
Python
scraper/storage_spiders/ibasicvietnamcom.py
chongiadung/choinho
d2a216fe7a5064d73cdee3e928a7beef7f511fd1
[ "MIT" ]
null
null
null
scraper/storage_spiders/ibasicvietnamcom.py
chongiadung/choinho
d2a216fe7a5064d73cdee3e928a7beef7f511fd1
[ "MIT" ]
10
2020-02-11T23:34:28.000Z
2022-03-11T23:16:12.000Z
scraper/storage_spiders/ibasicvietnamcom.py
chongiadung/choinho
d2a216fe7a5064d73cdee3e928a7beef7f511fd1
[ "MIT" ]
3
2018-08-05T14:54:25.000Z
2021-06-07T01:49:59.000Z
# Auto generated by generator.py. Delete this line if you make modification. from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//div[@class='product-details']/h1", 'price' : "//div[@id='product-price']", 'category' : "//ol[@class='breadcrumb']/li/a", 'd...
36.037037
86
0.631038
from scrapy.spiders import Rule from scrapy.linkextractors import LinkExtractor XPATH = { 'name' : "//div[@class='product-details']/h1", 'price' : "//div[@id='product-price']", 'category' : "//ol[@class='breadcrumb']/li/a", 'description' : "//div[@class='product-details']//div[@class='tab-content']//p"...
true
true
f7790ba3ebc5fd5195646a4c1fb0d7cea80d70a3
8,679
py
Python
PyObjCTest/test_conversion.py
linuxfood/pyobjc-framework-Cocoa-test
3475890f165ab26a740f13d5afe4c62b4423a140
[ "MIT" ]
null
null
null
PyObjCTest/test_conversion.py
linuxfood/pyobjc-framework-Cocoa-test
3475890f165ab26a740f13d5afe4c62b4423a140
[ "MIT" ]
null
null
null
PyObjCTest/test_conversion.py
linuxfood/pyobjc-framework-Cocoa-test
3475890f165ab26a740f13d5afe4c62b4423a140
[ "MIT" ]
null
null
null
import datetime import decimal import Cocoa from objc._pythonify import OC_PythonFloat from PyObjCTools import Conversion from PyObjCTools.TestSupport import TestCase import objc class TestConversion(TestCase): def test_toPythonDecimal(self): v = Cocoa.NSDecimalNumber.decimalNumberWithString_(u"42.5") ...
36.466387
88
0.608826
import datetime import decimal import Cocoa from objc._pythonify import OC_PythonFloat from PyObjCTools import Conversion from PyObjCTools.TestSupport import TestCase import objc class TestConversion(TestCase): def test_toPythonDecimal(self): v = Cocoa.NSDecimalNumber.decimalNumberWithString_(u"42.5") ...
true
true
f7790c130b68c28bd26eca7959828dd9aba584e9
1,529
py
Python
GCData_22/.ipynb_checkpoints/NamePreferences-checkpoint.py
TomCallingham/Callingham22_MW_GCs
3ccc0226ea1466212a169aacfa4ce6e92f445e5a
[ "MIT" ]
null
null
null
GCData_22/.ipynb_checkpoints/NamePreferences-checkpoint.py
TomCallingham/Callingham22_MW_GCs
3ccc0226ea1466212a169aacfa4ce6e92f445e5a
[ "MIT" ]
null
null
null
GCData_22/.ipynb_checkpoints/NamePreferences-checkpoint.py
TomCallingham/Callingham22_MW_GCs
3ccc0226ea1466212a169aacfa4ce6e92f445e5a
[ "MIT" ]
null
null
null
### Variant_Names alt_name_parse = {} # Terzan alt_name_parse = alt_name_parse | {f"Ter{i}": f"Terzan{i}" for i in range(1, 15)} # Palomar alt_name_parse = alt_name_parse | {f"Palomar{i}": f"Pal{i}" for i in range(1, 20)} # Djorg alt_name_parse = alt_name_parse | {f"Djor{i}": f"Djorg{i}" for i in range(1, 4)} alt_nam...
26.824561
82
0.684761
alt_name_parse = {} alt_name_parse = alt_name_parse | {f"Ter{i}": f"Terzan{i}" for i in range(1, 15)} alt_name_parse = alt_name_parse | {f"Palomar{i}": f"Pal{i}" for i in range(1, 20)} alt_name_parse = alt_name_parse | {f"Djor{i}": f"Djorg{i}" for i in range(1, 4)} alt_name_parse = alt_name_parse | {f"Dorg{i}": f"Djo...
true
true
f7790c2aa15de2658510397f538b4a9db0301bc2
322
py
Python
pluralkit/__init__.py
Johnystar/pluralkit.py
96ab22d021c4f83b44bc474fce7c4847043d5dc2
[ "MIT" ]
null
null
null
pluralkit/__init__.py
Johnystar/pluralkit.py
96ab22d021c4f83b44bc474fce7c4847043d5dc2
[ "MIT" ]
2
2021-01-23T21:09:10.000Z
2021-01-25T11:26:03.000Z
pluralkit/__init__.py
Johnystar/pluralkit.py
96ab22d021c4f83b44bc474fce7c4847043d5dc2
[ "MIT" ]
null
null
null
""" PluralKit API Wrapper ~~~~~~~~~~~~~~~~~~~ A basic wrapper for the PluralKit API. :copyright: (c) 2021-present Johnystar :license: MIT, see LICENSE for more details. """ __title__ = 'pluralkit' __author__ = 'Johnystar' __license__ = 'MIT' __copyright__ = 'Copyright 2021-present Johnystar' __version__ = '2021.01.23....
24.769231
50
0.704969
__title__ = 'pluralkit' __author__ = 'Johnystar' __license__ = 'MIT' __copyright__ = 'Copyright 2021-present Johnystar' __version__ = '2021.01.23.1'
true
true
f7790c2f07717c103bdca9131b5a259d1f2639df
2,161
py
Python
docs/_scripts/generate_gif_image.py
dkkim93/PettingZoo
45e9c8f202b80fbc509232a44a771fa7156b5937
[ "MIT" ]
null
null
null
docs/_scripts/generate_gif_image.py
dkkim93/PettingZoo
45e9c8f202b80fbc509232a44a771fa7156b5937
[ "MIT" ]
null
null
null
docs/_scripts/generate_gif_image.py
dkkim93/PettingZoo
45e9c8f202b80fbc509232a44a771fa7156b5937
[ "MIT" ]
null
null
null
import random import time import numpy as np import json from pettingzoo.tests.all_modules import all_environments from pettingzoo.classic import gin_rummy_v0 from PIL import Image import os import scipy.misc import sys import subprocess def generate_data(nameline,module): dir = f"frames/{nameline}/" os.mkdir...
29.202703
103
0.607589
import random import time import numpy as np import json from pettingzoo.tests.all_modules import all_environments from pettingzoo.classic import gin_rummy_v0 from PIL import Image import os import scipy.misc import sys import subprocess def generate_data(nameline,module): dir = f"frames/{nameline}/" os.mkdir...
true
true
f7790c6a4ab9929d625a8195c8bcc5c749e1200c
2,326
py
Python
2 - Machine Learning/4_New Model - XGBoost - Final Model.py
dkim319/NFL_Predictive_Model_v2
5884e10a681e2e34f54a2280c94d2f42fc442d17
[ "CNRI-Python" ]
1
2019-09-14T04:04:51.000Z
2019-09-14T04:04:51.000Z
2 - Machine Learning/4_New Model - XGBoost - Final Model.py
dkim319/NFL_Predictive_Model_v2
5884e10a681e2e34f54a2280c94d2f42fc442d17
[ "CNRI-Python" ]
null
null
null
2 - Machine Learning/4_New Model - XGBoost - Final Model.py
dkim319/NFL_Predictive_Model_v2
5884e10a681e2e34f54a2280c94d2f42fc442d17
[ "CNRI-Python" ]
null
null
null
# -*- coding: utf-8 -*- """ Created on Mon Aug 14 20:21:23 2017 @author: DKIM """ #Run 3b- Supporting Functions import pandas as pd import numpy as np import xgboost as xgb from sklearn import feature_selection seednumber = 319 # load data start_year = 2014 target_year = 2018 data_train, data_test, features_trai...
30.605263
134
0.77558
import pandas as pd import numpy as np import xgboost as xgb from sklearn import feature_selection seednumber = 319 start_year = 2014 target_year = 2018 data_train, data_test, features_train, target_train, features_test, target_test = load_data(start_year, target_year) from datetime import datetime timestart = da...
true
true
f7790c917fcb3c427c96d7025b9b6a3ae6abf14c
6,005
py
Python
src/utils/jwt.py
staugur/SwarmOpsApi
5960cd332f0c7fa79446d185ce0712be1acd7089
[ "BSD-3-Clause" ]
72
2016-12-22T02:31:13.000Z
2021-11-27T06:50:51.000Z
src/utils/jwt.py
saintic/SwarmOpsApi
5960cd332f0c7fa79446d185ce0712be1acd7089
[ "BSD-3-Clause" ]
3
2017-04-27T07:10:58.000Z
2021-10-17T07:16:31.000Z
src/utils/jwt.py
saintic/SwarmOpsApi
5960cd332f0c7fa79446d185ce0712be1acd7089
[ "BSD-3-Clause" ]
48
2016-12-22T02:31:16.000Z
2021-11-27T06:57:55.000Z
# -*- coding: utf-8 -*- """ SwarmOps.utils.jwt ~~~~~~~~~~~~~~ Json Web Token :copyright: (c) 2018 by staugur. :license: MIT, see LICENSE for more details. """ import hashlib import hmac import time import datetime import random import base64 import json from config import SYSTEM class JWTExcept...
32.814208
115
0.590508
import hashlib import hmac import time import datetime import random import base64 import json from config import SYSTEM class JWTException(Exception): pass class SignatureBadError(JWTException): pass class TokenExpiredError(JWTException): pass class InvalidTokenError(JWTException): pass clas...
true
true
f7790cf2ef2184a037d8d2a323d356159cfc9af9
2,272
py
Python
src/vardb/datamodel/migration/alembic/versions/022118518e99_add_json_schema_table.py
Dabble-of-DevOps-Bio/ella
e38631d302611a143c9baaa684bcbd014d9734e4
[ "MIT" ]
null
null
null
src/vardb/datamodel/migration/alembic/versions/022118518e99_add_json_schema_table.py
Dabble-of-DevOps-Bio/ella
e38631d302611a143c9baaa684bcbd014d9734e4
[ "MIT" ]
null
null
null
src/vardb/datamodel/migration/alembic/versions/022118518e99_add_json_schema_table.py
Dabble-of-DevOps-Bio/ella
e38631d302611a143c9baaa684bcbd014d9734e4
[ "MIT" ]
null
null
null
"""Add JSON schema table Revision ID: 022118518e99 Revises: 4fef0af39a20 Create Date: 2019-02-28 07:25:25.613054 """ # revision identifiers, used by Alembic. revision = "022118518e99" down_revision = "4fef0af39a20" branch_labels = None depends_on = None from alembic import op from sqlalchemy.orm.session import Sess...
33.910448
109
0.705106
revision = "022118518e99" down_revision = "4fef0af39a20" branch_labels = None depends_on = None from alembic import op from sqlalchemy.orm.session import Session import sqlalchemy as sa from sqlalchemy.dialects import postgresql from vardb.datamodel.jsonschemas.update_schemas import update_schemas def upgrade(): ...
true
true
f7790dae8f54e5fac4f017b3b8f50883a7f35665
6,578
py
Python
virtual/lib/python3.6/site-packages/pylint/graph.py
drewheathens/The-Moringa-Tribune
98ee4d63c9df6f1f7497fc6876960a822d914500
[ "MIT" ]
69
2019-02-18T12:07:35.000Z
2022-03-12T10:38:32.000Z
virtual/lib/python3.6/site-packages/pylint/graph.py
drewheathens/The-Moringa-Tribune
98ee4d63c9df6f1f7497fc6876960a822d914500
[ "MIT" ]
16
2020-02-12T00:28:11.000Z
2022-03-11T23:48:19.000Z
virtual/lib/python3.6/site-packages/pylint/graph.py
drewheathens/The-Moringa-Tribune
98ee4d63c9df6f1f7497fc6876960a822d914500
[ "MIT" ]
28
2019-03-22T01:07:13.000Z
2022-02-21T16:38:27.000Z
# Copyright (c) 2015-2017 Claudiu Popa <pcmanticore@gmail.com> # Copyright (c) 2015 Florian Bruhin <me@the-compiler.org> # Copyright (c) 2016 Ashley Whetter <ashley@awhetter.co.uk> # Copyright (c) 2018 ssolanki <sushobhitsolanki@gmail.com> # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.htm...
33.055276
84
0.553816
import os.path as osp import os import sys import tempfile import codecs def target_info_from_filename(filename): basename = osp.basename(filename) storedir = osp.dirname(osp.abspath(filename)) target = filename.split(".")[-1] return storedir, basename, target class DotBackend: def __init__(...
true
true
f7790dfa240cf5539333eb0bb0bcafebf3333740
271
py
Python
chemicalx/models/caster.py
andrejlamov/chemicalx
02cf0fdffd3bfac15dc8454a4f60ac615f2045b4
[ "Apache-2.0" ]
null
null
null
chemicalx/models/caster.py
andrejlamov/chemicalx
02cf0fdffd3bfac15dc8454a4f60ac615f2045b4
[ "Apache-2.0" ]
null
null
null
chemicalx/models/caster.py
andrejlamov/chemicalx
02cf0fdffd3bfac15dc8454a4f60ac615f2045b4
[ "Apache-2.0" ]
null
null
null
"""An implementation of the CASTER model.""" from .base import UnimplementedModel __all__ = [ "CASTER", ] class CASTER(UnimplementedModel): """An implementation of the CASTER model. .. seealso:: https://github.com/AstraZeneca/chemicalx/issues/15 """
18.066667
67
0.690037
from .base import UnimplementedModel __all__ = [ "CASTER", ] class CASTER(UnimplementedModel):
true
true
f7790e57d4f4a180861d0a627b769ad7c786061e
3,487
py
Python
record_shop/settings.py
luizcartolano2/record-shop
e286e8f15c2ce4a915839c31ec6b769b19959242
[ "MIT" ]
null
null
null
record_shop/settings.py
luizcartolano2/record-shop
e286e8f15c2ce4a915839c31ec6b769b19959242
[ "MIT" ]
1
2022-03-14T23:03:33.000Z
2022-03-14T23:03:33.000Z
record_shop/settings.py
luizcartolano2/record-shop
e286e8f15c2ce4a915839c31ec6b769b19959242
[ "MIT" ]
null
null
null
""" Django settings for record_shop project. Generated by 'django-admin startproject' using Django 4.0.3. For more information on this file, see https://docs.djangoproject.com/en/4.0/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/4.0/ref/settings/ """ import os...
26.823077
91
0.700315
import os from pathlib import Path BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = 'django-insecure-r(-z+%#%c849^(clq16l4(#taf!x5k2u_-$u^*sacj7))pb#r2' DEBUG = True ALLOWED_HOSTS = ['*'] AUTH_USER_MODEL = 'ecommerce.User' # Application definition INSTALLED_APPS = [ 'django.contrib.admin', ...
true
true
f7790ed484a57fb636142802cbf795567e99ba05
556
py
Python
examples/set_active_layer.py
13751742405/photoshop-python-api
5fe9b46dd2b2b4e2e1e6ef99a68d68b4fc032a70
[ "MIT" ]
null
null
null
examples/set_active_layer.py
13751742405/photoshop-python-api
5fe9b46dd2b2b4e2e1e6ef99a68d68b4fc032a70
[ "MIT" ]
null
null
null
examples/set_active_layer.py
13751742405/photoshop-python-api
5fe9b46dd2b2b4e2e1e6ef99a68d68b4fc032a70
[ "MIT" ]
null
null
null
""" References: https://github.com/lohriialo/photoshop-scripting-python/blob/master/ActiveLayer.py """ import photoshop.api as ps app = ps.Application() if app.documents.length < 1: docRef = app.documents.add() else: docRef = app.activeDocument if docRef.layers.length < 2: docRef.artLayers.add() ac...
24.173913
86
0.741007
import photoshop.api as ps app = ps.Application() if app.documents.length < 1: docRef = app.documents.add() else: docRef = app.activeDocument if docRef.layers.length < 2: docRef.artLayers.add() activeLayerName = docRef.activeLayer.name if docRef.activeLayer.name != docRef.layers.item(docRef.layers.lengt...
true
true
f7791171458761e62bbcbe0c216f243692245ebc
357
py
Python
python/1036.py
clebsonc/UriOnlineJudge
763cef77cf3d5088be34c54b0cf457c6ef90a88f
[ "MIT" ]
null
null
null
python/1036.py
clebsonc/UriOnlineJudge
763cef77cf3d5088be34c54b0cf457c6ef90a88f
[ "MIT" ]
null
null
null
python/1036.py
clebsonc/UriOnlineJudge
763cef77cf3d5088be34c54b0cf457c6ef90a88f
[ "MIT" ]
null
null
null
import numpy as np buf = raw_input() a = float(buf.split(" ")[0]) b = float(buf.split(" ")[1]) c = float(buf.split(" ")[2]) delta = (b**2)-(4*a*c) if delta < 0 or a == 0.0: print "Impossivel calcular" else: x1 = (-b + np.sqrt(delta))/(2*a) x2 = (-b - np.sqrt(delta))/(2*a) print "R1 =", format(x1,".5f"...
22.3125
36
0.526611
import numpy as np buf = raw_input() a = float(buf.split(" ")[0]) b = float(buf.split(" ")[1]) c = float(buf.split(" ")[2]) delta = (b**2)-(4*a*c) if delta < 0 or a == 0.0: print "Impossivel calcular" else: x1 = (-b + np.sqrt(delta))/(2*a) x2 = (-b - np.sqrt(delta))/(2*a) print "R1 =", format(x1,".5f"...
false
true
f77911f005ec631b7d74c39dcc9798612bf6f966
348
py
Python
api/assessments/serializers.py
xuanqiz/mhdb-tables2api
57deb06bc7c132135517c32a0708dcb38e8720e1
[ "Apache-2.0" ]
null
null
null
api/assessments/serializers.py
xuanqiz/mhdb-tables2api
57deb06bc7c132135517c32a0708dcb38e8720e1
[ "Apache-2.0" ]
null
null
null
api/assessments/serializers.py
xuanqiz/mhdb-tables2api
57deb06bc7c132135517c32a0708dcb38e8720e1
[ "Apache-2.0" ]
1
2021-03-24T12:51:20.000Z
2021-03-24T12:51:20.000Z
from rest_framework import serializers from assessments.models import Questionnaire, Author class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = '__all__' class QuestionnaireSerializer(serializers.ModelSerializer): class Meta: model = Questionnaire ...
23.2
59
0.732759
from rest_framework import serializers from assessments.models import Questionnaire, Author class AuthorSerializer(serializers.ModelSerializer): class Meta: model = Author fields = '__all__' class QuestionnaireSerializer(serializers.ModelSerializer): class Meta: model = Questionnaire ...
true
true
f77912fed3339467363a538576e5dabb6ca9ee10
6,718
py
Python
tensorflow_probability/python/internal/tensor_util.py
brianwa84/probability
6f8e78d859ac41170be5147c8c7bde54cc5aa83e
[ "Apache-2.0" ]
2
2020-02-21T06:30:00.000Z
2021-08-08T19:29:15.000Z
tensorflow_probability/python/internal/tensor_util.py
brianwa84/probability
6f8e78d859ac41170be5147c8c7bde54cc5aa83e
[ "Apache-2.0" ]
null
null
null
tensorflow_probability/python/internal/tensor_util.py
brianwa84/probability
6f8e78d859ac41170be5147c8c7bde54cc5aa83e
[ "Apache-2.0" ]
1
2020-05-31T13:08:33.000Z
2020-05-31T13:08:33.000Z
# 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...
32.931373
80
0.702888
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 dtype_util from tensorflow_probability.python.internal import prefer_static __all__ = [ 'convert_nonref_to_tensor', ...
true
true
f7791334dada068ecb7a96042a1ce45df92058c4
1,307
py
Python
Problem 17/advent17a_v2.py
mankybansal/advent-of-code-2020
62b389c52d488ea88443b564b6b6b89fd7b5290b
[ "Apache-2.0" ]
null
null
null
Problem 17/advent17a_v2.py
mankybansal/advent-of-code-2020
62b389c52d488ea88443b564b6b6b89fd7b5290b
[ "Apache-2.0" ]
null
null
null
Problem 17/advent17a_v2.py
mankybansal/advent-of-code-2020
62b389c52d488ea88443b564b6b6b89fd7b5290b
[ "Apache-2.0" ]
null
null
null
n = 8 grid = [[['.' for _ in range(n)] for _ in range(n)] for _ in range(n)] grid[n // 2] = [list(l.strip()) for l in open('input_v2.txt', 'r').readlines()] dirs = [(x, y, z) for x in [-1, 0, 1] for y in [-1, 0, 1] for z in [-1, 0, 1]] dirs.remove((0, 0, 0)) def cycle(i, n_new, new_grid): active_count = 0 for x in...
31.878049
97
0.563887
n = 8 grid = [[['.' for _ in range(n)] for _ in range(n)] for _ in range(n)] grid[n // 2] = [list(l.strip()) for l in open('input_v2.txt', 'r').readlines()] dirs = [(x, y, z) for x in [-1, 0, 1] for y in [-1, 0, 1] for z in [-1, 0, 1]] dirs.remove((0, 0, 0)) def cycle(i, n_new, new_grid): active_count = 0 for x in...
true
true
f77913c2607dd152e0abe0484aa8e4fd94728ea8
23
py
Python
Client/__init__.py
Zxayler/dpy-handler
1a24464654a2cfaa99200d0fb30b66478ca44ab4
[ "MIT" ]
null
null
null
Client/__init__.py
Zxayler/dpy-handler
1a24464654a2cfaa99200d0fb30b66478ca44ab4
[ "MIT" ]
null
null
null
Client/__init__.py
Zxayler/dpy-handler
1a24464654a2cfaa99200d0fb30b66478ca44ab4
[ "MIT" ]
null
null
null
from .bot import Client
23
23
0.826087
from .bot import Client
true
true
f77913f2fd0112bc36727435e1669b8f97bac817
2,660
py
Python
main2.py
hhhzhao/E04a-Sprites
a29ef1b1926b0b6f876e3ee4d8e2259b9b895112
[ "MIT" ]
null
null
null
main2.py
hhhzhao/E04a-Sprites
a29ef1b1926b0b6f876e3ee4d8e2259b9b895112
[ "MIT" ]
null
null
null
main2.py
hhhzhao/E04a-Sprites
a29ef1b1926b0b6f876e3ee4d8e2259b9b895112
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 import utils, os, random, time, open_color, arcade utils.check_version((3,7)) SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 SCREEN_TITLE = "Sprites Example" class Emote(arcade.Sprite): def __init__(self): super().__init__() self.frequency = 1 #update every second ...
30.574713
280
0.639098
import utils, os, random, time, open_color, arcade utils.check_version((3,7)) SCREEN_WIDTH = 800 SCREEN_HEIGHT = 600 SCREEN_TITLE = "Sprites Example" class Emote(arcade.Sprite): def __init__(self): super().__init__() self.frequency = 1 self.timer = time.time() emotes = ['alert',...
true
true
f77914b288491a41930fc05b83d08016de4df2d5
25,879
py
Python
spyonde/spyondemain.py
caglartoklu/spyonde
04f41d2089f51d0ab826f60a38c54908112fe77a
[ "MIT" ]
1
2022-03-08T11:08:20.000Z
2022-03-08T11:08:20.000Z
spyonde/spyondemain.py
caglartoklu/spyonde
04f41d2089f51d0ab826f60a38c54908112fe77a
[ "MIT" ]
17
2020-04-22T10:38:24.000Z
2021-04-26T10:01:28.000Z
spyonde/spyondemain.py
caglartoklu/spyonde
04f41d2089f51d0ab826f60a38c54908112fe77a
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ Converts cell separated regular Python scripts to Jupyter notebooks. With Spyonde, it is possible to use any IDE/editor to create Jupyter notebooks, presenatations and lecture notes. """ # pylint: disable=line-too-long import argparse import json import os import re import tokenize _...
27.826882
101
0.616948
import argparse import json import os import re import tokenize __TOKEN_CELL_SEPS = ["#%%", "# %%", "# <codecell>"] __CELL_TYPE_MARKDOWN = "markdown" __CELL_TYPE_CODE = "code" __COMMENT_STARTER = "#" def starts_with(haystack, needle): assert isinstance(haystack, list) assert isinstance(needle, str) ...
true
true
f779177117823c046224b444c44387eefac4b92e
8,853
py
Python
Lib/javapath.py
M-Spencer-94/configNOW
56828587253202089e77cfdfcf5329f2a7f09b3f
[ "PSF-2.0", "Apache-2.0", "MIT" ]
3
2019-07-09T20:02:48.000Z
2021-11-21T20:00:37.000Z
Lib/javapath.py
M-Spencer-94/configNOW
56828587253202089e77cfdfcf5329f2a7f09b3f
[ "PSF-2.0", "Apache-2.0", "MIT" ]
null
null
null
Lib/javapath.py
M-Spencer-94/configNOW
56828587253202089e77cfdfcf5329f2a7f09b3f
[ "PSF-2.0", "Apache-2.0", "MIT" ]
null
null
null
"""Common pathname manipulations, JDK version. Instead of importing this module directly, import os and refer to this module as os.path. """ # Incompletely implemented: # islink -- How? # ismount -- How? # splitdrive -- How? # normcase -- How? # Missing: # sameopenfile -- Java doesn't have fstat nor file descriptor...
26.665663
77
0.564893
"""Common pathname manipulations, JDK version. Instead of importing this module directly, import os and refer to this module as os.path. """ # samestat -- How? import java from java.io import File from java.lang import System import os def _tostr(s, method): if isinstance(s, "".__class__): return s ...
false
true
f77917f989d58a3fcc9d35f3408897331b2ade81
4,600
py
Python
plotting/plot_laptime_evaluation.py
axelbr/dreamer
775cd521b12d7c8f753e790844285d933e460234
[ "MIT" ]
1
2020-10-14T13:48:09.000Z
2020-10-14T13:48:09.000Z
plotting/plot_laptime_evaluation.py
axelbr/dreamer
775cd521b12d7c8f753e790844285d933e460234
[ "MIT" ]
null
null
null
plotting/plot_laptime_evaluation.py
axelbr/dreamer
775cd521b12d7c8f753e790844285d933e460234
[ "MIT" ]
null
null
null
import argparse import time import pathlib import warnings from datetime import datetime from tensorboard.backend.event_processing.event_accumulator import EventAccumulator from plotting.aggregators import MeanStd, MeanMinMax from plotting.log_parsers import EvaluationParser from plotting.plot_test_evaluation import ...
47.916667
120
0.645217
import argparse import time import pathlib import warnings from datetime import datetime from tensorboard.backend.event_processing.event_accumulator import EventAccumulator from plotting.aggregators import MeanStd, MeanMinMax from plotting.log_parsers import EvaluationParser from plotting.plot_test_evaluation import ...
true
true
f77918120e8b1507b831fec67024765e01481feb
3,829
py
Python
pictures/settings.py
JeremiahNgige/gallery
572c24bd808ea6bc12411f0e72396449dcdfe4f5
[ "MIT" ]
null
null
null
pictures/settings.py
JeremiahNgige/gallery
572c24bd808ea6bc12411f0e72396449dcdfe4f5
[ "MIT" ]
null
null
null
pictures/settings.py
JeremiahNgige/gallery
572c24bd808ea6bc12411f0e72396449dcdfe4f5
[ "MIT" ]
null
null
null
""" Django settings for pictures project. Generated by 'django-admin startproject' using Django 3.1.2. For more information on this file, see https://docs.djangoproject.com/en/3.1/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.1/ref/settings/ """ from pathlib...
25.871622
91
0.694698
from pathlib import Path import os import dj_database_url import django_heroku from decouple import config, Csv BASE_DIR = Path(__file__).resolve().parent.parent DEBUG = True SECRET_KEY = config('SECRET_KEY') ALLOWED_HOSTS = ['*'] INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'd...
true
true
f77918b99c8b11dfb3c4787141aeb49278b817a1
2,692
py
Python
Component/tests/test_components.py
mst-solar-car/kicad-bom-generator
2aae905056d06f3d25343a8d784049c141d05640
[ "MIT" ]
3
2018-02-26T12:31:41.000Z
2020-10-10T14:14:11.000Z
Component/tests/test_components.py
mst-solar-car/kicad-bom-generator
2aae905056d06f3d25343a8d784049c141d05640
[ "MIT" ]
null
null
null
Component/tests/test_components.py
mst-solar-car/kicad-bom-generator
2aae905056d06f3d25343a8d784049c141d05640
[ "MIT" ]
null
null
null
from __future__ import absolute_import from Component import * def test_default_values(): """ Tests the initial constructor values """ # Arrange expected_name = "" expected_footprint = "" expected_reference = "" expected_value = "" expected_quantity = 1 # Act component = KiCadComponent() # Asser...
22.433333
78
0.683507
from __future__ import absolute_import from Component import * def test_default_values(): expected_name = "" expected_footprint = "" expected_reference = "" expected_value = "" expected_quantity = 1 component = KiCadComponent() assert component["name"] == expected_name assert component["footpr...
true
true
f7791a425a7e71d200a790ccf9340733bc2929d2
597
py
Python
huoguoml/server/service/__init__.py
huoguoml/huoguoml
749b0b2a24ddcf1ab34c36267eae7a2427b907f4
[ "Apache-2.0" ]
5
2021-08-02T16:35:29.000Z
2022-03-28T13:07:38.000Z
huoguoml/server/service/__init__.py
huoguoml/huoguoml
749b0b2a24ddcf1ab34c36267eae7a2427b907f4
[ "Apache-2.0" ]
12
2021-07-03T19:00:07.000Z
2021-07-11T17:26:47.000Z
huoguoml/server/service/__init__.py
huoguoml/huoguoml
749b0b2a24ddcf1ab34c36267eae7a2427b907f4
[ "Apache-2.0" ]
null
null
null
import os from huoguoml.constants import HUOGUOML_DATABASE_FILE, HUOGUOML_DEFAULT_ZIP_FOLDER class Service(object): def __init__(self, artifact_dir: str): self.artifact_dir = os.path.realpath(artifact_dir) self.zip_dir = os.path.join(self.artifact_dir, HUOGUOML_DEFAULT_ZIP_FOLDER) if no...
33.166667
101
0.715243
import os from huoguoml.constants import HUOGUOML_DATABASE_FILE, HUOGUOML_DEFAULT_ZIP_FOLDER class Service(object): def __init__(self, artifact_dir: str): self.artifact_dir = os.path.realpath(artifact_dir) self.zip_dir = os.path.join(self.artifact_dir, HUOGUOML_DEFAULT_ZIP_FOLDER) if no...
true
true
f7791a8ae1b6a80c6f4c4c82ea89f9392000e1f8
7,719
py
Python
tools/generate-vunary-test.py
kounoike/XNNPACK
637a038d19958ad7e6203deddd1eeb3cb8619ec7
[ "BSD-3-Clause" ]
null
null
null
tools/generate-vunary-test.py
kounoike/XNNPACK
637a038d19958ad7e6203deddd1eeb3cb8619ec7
[ "BSD-3-Clause" ]
null
null
null
tools/generate-vunary-test.py
kounoike/XNNPACK
637a038d19958ad7e6203deddd1eeb3cb8619ec7
[ "BSD-3-Clause" ]
2
2022-02-09T01:58:11.000Z
2022-03-03T12:53:43.000Z
#!/usr/bin/env python # Copyright 2019 Google LLC # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import argparse import codecs import math import os import re import sys import yaml sys.path.insert(0, os.path.dirname(os.path.abspath(...
29.461832
153
0.62547
import argparse import codecs import math import os import re import sys import yaml sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) import xngen import xnncommon parser = argparse.ArgumentParser( description='Vector unary operation microkernel test generator') parser.add_argument("-s", "--spec", m...
true
true
f7791b9e405e1aeba547dfb85bca3a7019bf187a
2,615
py
Python
sdk/python/pulumi_azure_native/powerbi/list_workspace_collection_access_keys.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/powerbi/list_workspace_collection_access_keys.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/powerbi/list_workspace_collection_access_keys.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables __al...
34.407895
165
0.680306
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables __all__ = [ 'ListWorkspaceCollectionAccessKeysResult', 'AwaitableListWorkspaceCollectionAccessKeysResult', 'list_workspace_collection_access_keys', ] @pulumi.o...
true
true
f7791cc3c465782831bec1800119927b778ad07f
53,107
py
Python
process_data.py
Data-to-Knowledge/ConsentsReporting
d5152699a26860ea3ff63093ef11bd440a812e0f
[ "Apache-2.0" ]
null
null
null
process_data.py
Data-to-Knowledge/ConsentsReporting
d5152699a26860ea3ff63093ef11bd440a812e0f
[ "Apache-2.0" ]
null
null
null
process_data.py
Data-to-Knowledge/ConsentsReporting
d5152699a26860ea3ff63093ef11bd440a812e0f
[ "Apache-2.0" ]
2
2020-03-25T22:38:08.000Z
2020-11-01T23:03:09.000Z
# -*- coding: utf-8 -*- """ Created on Thu Jun 7 11:41:44 2018 @author: MichaelEK """ import os import argparse import types import pandas as pd import numpy as np from pdsql import mssql from datetime import datetime import yaml import itertools import lowflows as lf import util pd.options.display.max_columns = 10 ...
59.073415
365
0.664037
import os import argparse import types import pandas as pd import numpy as np from pdsql import mssql from datetime import datetime import yaml import itertools import lowflows as lf import util pd.options.display.max_columns = 10 run_time_start = datetime.today().strftime('%Y-%m-%d %H:%M:%S') print(run_time_start) t...
true
true
f7791d4413bd5a27a2b65e4b9835c244b28d9f0c
9,454
py
Python
linepy/object.py
rachaonline789/hellomod
ef3c8b96790169dd4c7b14458e165c20737dd184
[ "BSD-3-Clause" ]
98
2018-09-25T15:50:18.000Z
2021-09-29T12:52:57.000Z
linepy/object.py
rachaonline789/hellomod
ef3c8b96790169dd4c7b14458e165c20737dd184
[ "BSD-3-Clause" ]
1
2021-04-30T20:57:20.000Z
2021-04-30T20:57:20.000Z
linepy/object.py
rachaonline789/hellomod
ef3c8b96790169dd4c7b14458e165c20737dd184
[ "BSD-3-Clause" ]
83
2018-09-27T12:46:57.000Z
2022-03-12T10:54:39.000Z
# -*- coding: utf-8 -*- from datetime import datetime import json, time, ntpath def loggedIn(func): def checkLogin(*args, **kwargs): if args[0].isLogin: return func(*args, **kwargs) else: args[0].callback.default('You want to call the function, you must login to LINE') r...
41.464912
138
0.549291
from datetime import datetime import json, time, ntpath def loggedIn(func): def checkLogin(*args, **kwargs): if args[0].isLogin: return func(*args, **kwargs) else: args[0].callback.default('You want to call the function, you must login to LINE') return checkLogin cl...
true
true
f7791e3c996f51b2000c277124b2cf5a42e1b1b9
747
py
Python
geo/migrations/0006_alter_subregionsrelation_geog_type.py
WPRDC/neighborhood-simulacrum
46892dfdbc8bc3201e31fee4ee991c49b208753e
[ "MIT" ]
null
null
null
geo/migrations/0006_alter_subregionsrelation_geog_type.py
WPRDC/neighborhood-simulacrum
46892dfdbc8bc3201e31fee4ee991c49b208753e
[ "MIT" ]
null
null
null
geo/migrations/0006_alter_subregionsrelation_geog_type.py
WPRDC/neighborhood-simulacrum
46892dfdbc8bc3201e31fee4ee991c49b208753e
[ "MIT" ]
null
null
null
# Generated by Django 3.2.7 on 2021-10-26 21:37 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('geo', '0005_auto_20211026_1853'), ] operations = [ migrations.AlterField( model_name='subregionsrelation', name='geo...
39.315789
400
0.62249
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('geo', '0005_auto_20211026_1853'), ] operations = [ migrations.AlterField( model_name='subregionsrelation', name='geog_type', field=models.CharField(choi...
true
true
f7791ea457eb3898b71d96bc27f34714c2cbf024
1,053
py
Python
src/abaqus/EngineeringFeature/Crack.py
Haiiliin/PyAbaqus
f20db6ebea19b73059fe875a53be370253381078
[ "MIT" ]
7
2022-01-21T09:15:45.000Z
2022-02-15T09:31:58.000Z
src/abaqus/EngineeringFeature/Crack.py
Haiiliin/PyAbaqus
f20db6ebea19b73059fe875a53be370253381078
[ "MIT" ]
null
null
null
src/abaqus/EngineeringFeature/Crack.py
Haiiliin/PyAbaqus
f20db6ebea19b73059fe875a53be370253381078
[ "MIT" ]
null
null
null
from abaqusConstants import * class Crack: """The Crack object is the abstract base type for ContourIntegral and future crack objects. Attributes ---------- name: str A String specifying the repository key. suppressed: Boolean A Boolean specifying whether the crack is suppressed o...
25.071429
95
0.632479
from abaqusConstants import * class Crack: name: str = '' suppressed: Boolean = OFF def resume(self): pass def suppress(self): pass
true
true
f7791f6da3e95fe2cbd5cb982a803eff83898ccd
497
py
Python
samples/zeromq/capabilities_request/__main__.py
Neoklosch/fog_node_prototype
d3f07d9d161d97ec2c19f66167dfb26eb9c6e616
[ "Apache-2.0" ]
null
null
null
samples/zeromq/capabilities_request/__main__.py
Neoklosch/fog_node_prototype
d3f07d9d161d97ec2c19f66167dfb26eb9c6e616
[ "Apache-2.0" ]
null
null
null
samples/zeromq/capabilities_request/__main__.py
Neoklosch/fog_node_prototype
d3f07d9d161d97ec2c19f66167dfb26eb9c6e616
[ "Apache-2.0" ]
1
2017-08-29T20:37:12.000Z
2017-08-29T20:37:12.000Z
import signal import sys import threading from time import sleep import zmq context = zmq.Context() client = context.socket(zmq.REQ) def signal_handler(signal, frame): print('shutdown') sys.exit(0) def main(): client.connect("tcp://172.18.0.11:5091") client.send_string("") # Get the reply. ...
16.566667
52
0.663984
import signal import sys import threading from time import sleep import zmq context = zmq.Context() client = context.socket(zmq.REQ) def signal_handler(signal, frame): print('shutdown') sys.exit(0) def main(): client.connect("tcp://172.18.0.11:5091") client.send_string("") message = clie...
true
true
f7791f8e40aeb19dc7a9f9fd0f96eb0ad566c932
69,164
py
Python
python/ccxt/bitfinex2.py
npomfret/ccxt
55e64d28c1a4a4925353076af9880dc18101fb73
[ "MIT" ]
1
2021-12-21T12:03:43.000Z
2021-12-21T12:03:43.000Z
python/ccxt/bitfinex2.py
npomfret/ccxt
55e64d28c1a4a4925353076af9880dc18101fb73
[ "MIT" ]
null
null
null
python/ccxt/bitfinex2.py
npomfret/ccxt
55e64d28c1a4a4925353076af9880dc18101fb73
[ "MIT" ]
1
2022-02-09T12:27:05.000Z
2022-02-09T12:27:05.000Z
# -*- coding: utf-8 -*- # PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN: # https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code from ccxt.bitfinex import bitfinex import hashlib import math from ccxt.base.errors import ExchangeError from ccxt.base.errors import Authe...
43.554156
207
0.484399
from ccxt.bitfinex import bitfinex import hashlib import math from ccxt.base.errors import ExchangeError from ccxt.base.errors import AuthenticationError from ccxt.base.errors import PermissionDenied from ccxt.base.errors import ArgumentsRequired from ccxt.base.errors import BadRequest from ccxt.base.errors import Ba...
true
true
f7791f9474de6bd7026a327ab45c42f470d8585a
958
py
Python
PYSTUDY/modulelib.py
shi-cong/review
c8da7128ea18ecaa5849f2066d321e70d6f97f70
[ "Apache-2.0" ]
8
2017-10-22T00:24:42.000Z
2017-11-24T01:23:52.000Z
PYSTUDY/modulelib.py
shi-cong/review
c8da7128ea18ecaa5849f2066d321e70d6f97f70
[ "Apache-2.0" ]
2
2017-10-12T22:04:25.000Z
2017-10-12T23:43:48.000Z
PYSTUDY/modulelib.py
shi-cong/review
c8da7128ea18ecaa5849f2066d321e70d6f97f70
[ "Apache-2.0" ]
null
null
null
""" 模块库 """ import inspect def get_curent_module_classes(module): """ 获取制定模块的所有类 :param module: 模块 :return: 类的列表 """ classes = [] for name, obj in inspect.getmembers(module): if inspect.isclass(obj): classes.append(obj) return classes # print(inspect.getmembers...
20.382979
78
0.596033
import inspect def get_curent_module_classes(module): classes = [] for name, obj in inspect.getmembers(module): if inspect.isclass(obj): classes.append(obj) return classes def is_subclass(obj, cls): try: for i in obj.__bases__: if i is cls or isinstance(i...
true
true
f779204f00569f6d6131c00b80a3b0f06e0b99eb
5,998
py
Python
project/Scrawl/XiamiMusic/XiamiMusic.py
wei/listen-now
f7b5cfa2c11c38688237c1ec4c595fbc146b71f6
[ "MIT" ]
157
2018-06-16T16:47:20.000Z
2022-03-29T14:43:22.000Z
project/Scrawl/XiamiMusic/XiamiMusic.py
wei/listen-now
f7b5cfa2c11c38688237c1ec4c595fbc146b71f6
[ "MIT" ]
3
2019-01-29T07:44:20.000Z
2021-04-30T20:39:21.000Z
project/Scrawl/XiamiMusic/XiamiMusic.py
wei/listen-now
f7b5cfa2c11c38688237c1ec4c595fbc146b71f6
[ "MIT" ]
38
2018-07-15T12:43:21.000Z
2022-03-31T18:38:59.000Z
#!usr/bin/env python3 # @File:Scrawl_Xiamimusic.py # @Date:2018/5/10 # Author:Cat.1 import sys sys.path.append('..') import project.Config.config import project.Scrawl.XiamiMusic.XiamiHelper from project.Module import ReturnStatus from project.Module import RetDataModule import requests, re, json xiami_search_url_f...
42.539007
176
0.58953
import sys sys.path.append('..') import project.Config.config import project.Scrawl.XiamiMusic.XiamiHelper from project.Module import ReturnStatus from project.Module import RetDataModule import requests, re, json xiami_search_url_first ='http://api.xiami.com/web?key=' xiami_search_url_index ='&v=2.0&app_key=1&...
true
true
f77920ef033695e762d139ed92f48d3f6b614788
742
py
Python
weatherinfo.py
pcn/err-weather
8d48a134ca565ebadbd91632babc7716da09b482
[ "MIT" ]
1
2017-03-29T11:24:41.000Z
2017-03-29T11:24:41.000Z
weatherinfo.py
pcn/err-weather
8d48a134ca565ebadbd91632babc7716da09b482
[ "MIT" ]
null
null
null
weatherinfo.py
pcn/err-weather
8d48a134ca565ebadbd91632babc7716da09b482
[ "MIT" ]
3
2016-12-16T23:23:34.000Z
2021-03-17T20:53:34.000Z
#!/usr/bin/env python3 from errbot import BotPlugin, botcmd import telnetlib class Weatherinfo(BotPlugin): """grab short weather informations around the globe """ @botcmd(split_args_with=None) def weather(self, msg, args): """(!weather berlin) grab weather information for cities an regions ...
27.481481
75
0.59973
from errbot import BotPlugin, botcmd import telnetlib class Weatherinfo(BotPlugin): @botcmd(split_args_with=None) def weather(self, msg, args): host = 'graph.no' port = 79 timeout = 1 city = args[0] tn = telnetlib.Telnet(host, port, timeout) tn.write(str('o:...
true
true
f77921ad1877c8766a12d457e35caa59f0787dce
10,081
py
Python
lfs/marketing/tests.py
michael-hahn/django-lfs
26c3471a8f8d88269c84f714f507b952dfdb6397
[ "BSD-3-Clause" ]
345
2015-01-03T19:19:27.000Z
2022-03-20T11:00:50.000Z
lfs/marketing/tests.py
michael-hahn/django-lfs
26c3471a8f8d88269c84f714f507b952dfdb6397
[ "BSD-3-Clause" ]
73
2015-01-06T14:54:02.000Z
2022-03-11T23:11:34.000Z
lfs/marketing/tests.py
michael-hahn/django-lfs
26c3471a8f8d88269c84f714f507b952dfdb6397
[ "BSD-3-Clause" ]
148
2015-01-07T16:30:08.000Z
2022-03-25T21:20:58.000Z
from datetime import timedelta from django.test import TestCase from django.utils import timezone from lfs.addresses.models import Address from lfs.catalog.models import Category from lfs.catalog.models import Product import lfs.marketing.utils from lfs.marketing.models import Topseller from lfs.marketing.utils impor...
34.523973
98
0.638726
from datetime import timedelta from django.test import TestCase from django.utils import timezone from lfs.addresses.models import Address from lfs.catalog.models import Category from lfs.catalog.models import Product import lfs.marketing.utils from lfs.marketing.models import Topseller from lfs.marketing.utils impor...
true
true
f77921ed53bd989cfd4ee577d98dec3b06404713
875
py
Python
111 Minimum Depth of Binary Tree.py
scorpionpd/LeetCode-all
0d65494f37d093d650b83b93409e874c041f3abe
[ "MIT" ]
null
null
null
111 Minimum Depth of Binary Tree.py
scorpionpd/LeetCode-all
0d65494f37d093d650b83b93409e874c041f3abe
[ "MIT" ]
null
null
null
111 Minimum Depth of Binary Tree.py
scorpionpd/LeetCode-all
0d65494f37d093d650b83b93409e874c041f3abe
[ "MIT" ]
null
null
null
""" Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. """ __author__ = 'Danyang' class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None c...
27.34375
114
0.597714
__author__ = 'Danyang' class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def minDepth(self, root): return self.fathom(root, 0) def fathom(self, root, depth): if not root: return depth el...
true
true
f7792205a46452682d5f4b08e34dd349be7cc3ea
3,118
py
Python
combine2d/sandbox/Borden/perturbed_surface.py
phigre/cobi
bb6cd9a49eb22862be6d87f0a2b0c8baf65cadb5
[ "BSD-3-Clause" ]
4
2021-02-08T20:10:42.000Z
2022-03-09T12:43:16.000Z
combine2d/sandbox/Borden/perturbed_surface.py
phigre/cobi
bb6cd9a49eb22862be6d87f0a2b0c8baf65cadb5
[ "BSD-3-Clause" ]
5
2018-10-18T07:11:58.000Z
2018-12-09T23:16:10.000Z
combine2d/sandbox/Borden/perturbed_surface.py
phigre/COBBI
bb6cd9a49eb22862be6d87f0a2b0c8baf65cadb5
[ "BSD-3-Clause" ]
2
2018-12-30T13:13:55.000Z
2020-03-11T16:15:11.000Z
import torch import matplotlib.pyplot as plt import numpy as np import os import shutil from combine2d.core import gis, test_cases from combine2d.core.utils import NonRGIGlacierDirectory from combine2d.core.first_guess import compile_first_guess from combine2d.core.inversion import InversionDirectory from combine2d.co...
32.14433
80
0.665491
import torch import matplotlib.pyplot as plt import numpy as np import os import shutil from combine2d.core import gis, test_cases from combine2d.core.utils import NonRGIGlacierDirectory from combine2d.core.first_guess import compile_first_guess from combine2d.core.inversion import InversionDirectory from combine2d.co...
true
true
f7792217e90f26272bcf4845890b67c9f707210b
2,167
py
Python
src/sentry/api/serializers/models/organization.py
mattrobenolt/sentry
3468714db277391de6cbcfda20842e6b460eecb3
[ "BSD-3-Clause" ]
null
null
null
src/sentry/api/serializers/models/organization.py
mattrobenolt/sentry
3468714db277391de6cbcfda20842e6b460eecb3
[ "BSD-3-Clause" ]
null
null
null
src/sentry/api/serializers/models/organization.py
mattrobenolt/sentry
3468714db277391de6cbcfda20842e6b460eecb3
[ "BSD-3-Clause" ]
null
null
null
from __future__ import absolute_import from sentry.app import quotas from sentry.api.serializers import Serializer, register, serialize from sentry.auth import access from sentry.models import ( Organization, OrganizationAccessRequest, OrganizationOption, Team, TeamStatus ) @register(Organization) class Orga...
33.859375
84
0.63221
from __future__ import absolute_import from sentry.app import quotas from sentry.api.serializers import Serializer, register, serialize from sentry.auth import access from sentry.models import ( Organization, OrganizationAccessRequest, OrganizationOption, Team, TeamStatus ) @register(Organization) class Orga...
true
true
f779226a100f766d076f2831641d56ff1e40d499
4,051
py
Python
v1.0.0.test/toontown/effects/IceCream.py
TTOFFLINE-LEAK/ttoffline
bb0e91704a755d34983e94288d50288e46b68380
[ "MIT" ]
4
2019-07-01T15:46:43.000Z
2021-07-23T16:26:48.000Z
v2.5.7/toontown/effects/IceCream.py
TTOFFLINE-LEAK/ttoffline
bb0e91704a755d34983e94288d50288e46b68380
[ "MIT" ]
1
2019-06-29T03:40:05.000Z
2021-06-13T01:15:16.000Z
v1.0.0.test/toontown/effects/IceCream.py
TTOFFLINE-LEAK/ttoffline
bb0e91704a755d34983e94288d50288e46b68380
[ "MIT" ]
4
2019-07-28T21:18:46.000Z
2021-02-25T06:37:25.000Z
from panda3d.core import * from panda3d.physics import * from direct.interval.IntervalGlobal import * from direct.particles import ParticleEffect, Particles, ForceGroup from EffectController import EffectController from PooledEffect import PooledEffect class IceCream(PooledEffect, EffectController): def __init__(...
44.032609
208
0.682794
from panda3d.core import * from panda3d.physics import * from direct.interval.IntervalGlobal import * from direct.particles import ParticleEffect, Particles, ForceGroup from EffectController import EffectController from PooledEffect import PooledEffect class IceCream(PooledEffect, EffectController): def __init__(...
true
true
f779238000422971c92e653075cc48db3192b16a
15,442
py
Python
examples/pytorch/graphsage/train_cv_multi_gpu.py
jinghuix/dgl
fae26dd15caac92458a08ad34889086e1e333ddd
[ "Apache-2.0" ]
1
2019-03-18T03:33:04.000Z
2019-03-18T03:33:04.000Z
examples/pytorch/graphsage/train_cv_multi_gpu.py
jinghuix/dgl
fae26dd15caac92458a08ad34889086e1e333ddd
[ "Apache-2.0" ]
null
null
null
examples/pytorch/graphsage/train_cv_multi_gpu.py
jinghuix/dgl
fae26dd15caac92458a08ad34889086e1e333ddd
[ "Apache-2.0" ]
1
2021-03-09T12:42:46.000Z
2021-03-09T12:42:46.000Z
import dgl import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.multiprocessing as mp import dgl.function as fn import dgl.nn.pytorch as dglnn import time import argparse import tqdm import traceback from _thread import start_new_thread fro...
38.412935
120
0.605945
import dgl import numpy as np import torch as th import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import torch.multiprocessing as mp import dgl.function as fn import dgl.nn.pytorch as dglnn import time import argparse import tqdm import traceback from _thread import start_new_thread fro...
true
true
f7792580e49a7e370278cd32e9f5198f11a89335
393
py
Python
v1/users/migrations/0007_user_is_email_verified.py
buckyroberts/Website-API
e74d202a41533c7622acbe12c793d047d44012ad
[ "MIT" ]
64
2020-10-02T02:58:06.000Z
2022-01-29T20:00:50.000Z
v1/users/migrations/0007_user_is_email_verified.py
buckyroberts/Website-API
e74d202a41533c7622acbe12c793d047d44012ad
[ "MIT" ]
93
2020-10-04T22:53:46.000Z
2022-03-05T18:17:46.000Z
v1/users/migrations/0007_user_is_email_verified.py
buckyroberts/Website-API
e74d202a41533c7622acbe12c793d047d44012ad
[ "MIT" ]
21
2020-10-11T14:16:13.000Z
2021-11-09T17:50:25.000Z
# Generated by Django 3.1.3 on 2020-12-28 01:45 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0006_auto_20201228_0142'), ] operations = [ migrations.AddField( model_name='user', name='is_email_verified'...
21.833333
53
0.608142
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('users', '0006_auto_20201228_0142'), ] operations = [ migrations.AddField( model_name='user', name='is_email_verified', field=models.BooleanField(default=...
true
true
f77925df670b98fabcf70c8d2ab7b07642bcdb10
2,628
py
Python
aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/UntagResourcesRequest.py
sdk-team/aliyun-openapi-python-sdk
384730d707e6720d1676ccb8f552e6a7b330ec86
[ "Apache-2.0" ]
null
null
null
aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/UntagResourcesRequest.py
sdk-team/aliyun-openapi-python-sdk
384730d707e6720d1676ccb8f552e6a7b330ec86
[ "Apache-2.0" ]
null
null
null
aliyun-python-sdk-ecs/aliyunsdkecs/request/v20140526/UntagResourcesRequest.py
sdk-team/aliyun-openapi-python-sdk
384730d707e6720d1676ccb8f552e6a7b330ec86
[ "Apache-2.0" ]
null
null
null
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
33.692308
80
0.753805
from aliyunsdkcore.request import RpcRequest class UntagResourcesRequest(RpcRequest): def __init__(self): RpcRequest.__init__(self, 'Ecs', '2014-05-26', 'UntagResources') self.set_method('POST') def get_ResourceOwnerId(self): return self.get_query_params().get('ResourceOwnerId') def set_ResourceOwne...
true
true
f77925f0ccf0f1f4b130bc790f02d0d99d77fb17
2,597
py
Python
tests/vision/models/visual_entailment_test.py
shunk031/allennlp-models
d37c5fadeef9326808a84dda0bcfd210a078d6b1
[ "Apache-2.0" ]
402
2020-03-11T22:58:35.000Z
2022-03-29T09:05:27.000Z
tests/vision/models/visual_entailment_test.py
staceywhitmore-inl/allennlp-models
1e89d5e51cb45f3e77a48d4983bf980088334fac
[ "Apache-2.0" ]
116
2020-03-11T01:26:57.000Z
2022-03-25T13:03:56.000Z
tests/vision/models/visual_entailment_test.py
staceywhitmore-inl/allennlp-models
1e89d5e51cb45f3e77a48d4983bf980088334fac
[ "Apache-2.0" ]
140
2020-03-11T00:51:35.000Z
2022-03-29T09:05:36.000Z
from torch.testing import assert_allclose from transformers import AutoModel from allennlp.common.testing import ModelTestCase from allennlp.data import Vocabulary from allennlp_models import vision # noqa: F401 from tests import FIXTURES_ROOT class TestVEVilbert(ModelTestCase): def test_model_can_train_save_...
37.637681
100
0.695418
from torch.testing import assert_allclose from transformers import AutoModel from allennlp.common.testing import ModelTestCase from allennlp.data import Vocabulary from allennlp_models import vision from tests import FIXTURES_ROOT class TestVEVilbert(ModelTestCase): def test_model_can_train_save_and_load_smal...
true
true
f77926739867ccb0ba3ead7c19a825c5fed22a96
487
py
Python
setup.py
NullHypothesis/onionperf
17b0cf422adc81d356d1db4aba46b495e9487d0b
[ "BSD-3-Clause" ]
1
2020-05-07T16:58:22.000Z
2020-05-07T16:58:22.000Z
setup.py
NullHypothesis/onionperf
17b0cf422adc81d356d1db4aba46b495e9487d0b
[ "BSD-3-Clause" ]
null
null
null
setup.py
NullHypothesis/onionperf
17b0cf422adc81d356d1db4aba46b495e9487d0b
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python3 from setuptools import setup with open('requirements.txt') as f: install_requires = f.readlines() setup(name='OnionPerf', version='0.3', description='A utility to monitor, measure, analyze, and visualize the performance of Tor and Onion Services', author='Rob Jansen', ...
28.647059
116
0.685832
from setuptools import setup with open('requirements.txt') as f: install_requires = f.readlines() setup(name='OnionPerf', version='0.3', description='A utility to monitor, measure, analyze, and visualize the performance of Tor and Onion Services', author='Rob Jansen', url='https://github....
true
true
f77926935d79d925cf33f5f71a211186018c666d
10,828
py
Python
deepclr/utils/metrics.py
mhorn11/deepclr
6ee21963a402776851950a51709eef849ff96b5f
[ "Apache-2.0" ]
8
2020-12-01T21:22:01.000Z
2022-03-13T13:11:56.000Z
deepclr/utils/metrics.py
mhorn11/deepclr
6ee21963a402776851950a51709eef849ff96b5f
[ "Apache-2.0" ]
null
null
null
deepclr/utils/metrics.py
mhorn11/deepclr
6ee21963a402776851950a51709eef849ff96b5f
[ "Apache-2.0" ]
null
null
null
from enum import auto from typing import Any, Callable, Dict, Optional import torch import torch.nn.functional as F from ..config.config import Config, ConfigEnum from ..data.labels import LabelType from ..utils.tensor import prepare_tensor from .quaternion import qconjugate, qmult MetricFunction = Callable[[torch....
41.171103
116
0.660417
from enum import auto from typing import Any, Callable, Dict, Optional import torch import torch.nn.functional as F from ..config.config import Config, ConfigEnum from ..data.labels import LabelType from ..utils.tensor import prepare_tensor from .quaternion import qconjugate, qmult MetricFunction = Callable[[torch....
true
true
f77926daa369ee0a10e4a0238d6ac9019104680d
159
py
Python
ruby/communication/messages/Incoming.py
0190342791072401740917904E9012740997199/TransformiceServer
39747a92581606014d7d26603bad00e7632d0617
[ "Unlicense" ]
1
2020-08-18T05:55:01.000Z
2020-08-18T05:55:01.000Z
ruby/communication/messages/Incoming.py
0190342791072401740917904E9012740997199/TransformiceServer
39747a92581606014d7d26603bad00e7632d0617
[ "Unlicense" ]
1
2022-03-12T15:30:31.000Z
2022-03-12T15:30:31.000Z
ruby/communication/messages/Incoming.py
0190342791072401740917904E9012740997199/TransformiceServer
39747a92581606014d7d26603bad00e7632d0617
[ "Unlicense" ]
5
2018-10-26T06:50:16.000Z
2021-11-06T11:41:36.000Z
from abc import abstractmethod class Incoming: tokens = [] @abstractmethod def dispatch(self, session, buffer_array): raise NotImplementedError
17.666667
72
0.742138
from abc import abstractmethod class Incoming: tokens = [] @abstractmethod def dispatch(self, session, buffer_array): raise NotImplementedError
true
true
f77927a2875e700eba45f56e0e79002bb831b8a8
55,246
py
Python
tests/test_sqlalchemy_data_layer.py
jy14898/flask-rest-jsonapi
5f06b8ce6dea77f2b43d6d9f5cc49099cc2ea64c
[ "MIT" ]
null
null
null
tests/test_sqlalchemy_data_layer.py
jy14898/flask-rest-jsonapi
5f06b8ce6dea77f2b43d6d9f5cc49099cc2ea64c
[ "MIT" ]
null
null
null
tests/test_sqlalchemy_data_layer.py
jy14898/flask-rest-jsonapi
5f06b8ce6dea77f2b43d6d9f5cc49099cc2ea64c
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from six.moves.urllib.parse import urlencode, parse_qs import pytest from sqlalchemy import create_engine, Column, Integer, DateTime, String, ForeignKey from sqlalchemy.orm import sessionmaker, relationship from sqlalchemy.ext.declarative import declarative_base from flask import Blueprint, ma...
35.6196
168
0.588857
from six.moves.urllib.parse import urlencode, parse_qs import pytest from sqlalchemy import create_engine, Column, Integer, DateTime, String, ForeignKey from sqlalchemy.orm import sessionmaker, relationship from sqlalchemy.ext.declarative import declarative_base from flask import Blueprint, make_response, json from m...
true
true
f779283f8cef0234dec565f0ddad20ad30629586
8,131
py
Python
st2client/st2client/commands/keyvalue.py
UbuntuEvangelist/st2
36af04f2caa03b396fb8ab00fd6d700e827fda8d
[ "Apache-2.0" ]
1
2020-11-21T10:11:25.000Z
2020-11-21T10:11:25.000Z
st2client/st2client/commands/keyvalue.py
UbuntuEvangelist/st2
36af04f2caa03b396fb8ab00fd6d700e827fda8d
[ "Apache-2.0" ]
1
2015-06-08T15:27:11.000Z
2015-06-08T15:27:11.000Z
st2client/st2client/commands/keyvalue.py
UbuntuEvangelist/st2
36af04f2caa03b396fb8ab00fd6d700e827fda8d
[ "Apache-2.0" ]
13
2017-01-12T11:07:20.000Z
2019-04-19T09:55:49.000Z
# Licensed to the StackStorm, Inc ('StackStorm') under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use th...
37.643519
100
0.639036
import os import json import logging from os.path import join as pjoin from st2client.commands import resource from st2client.commands.noop import NoopCommand from st2client.commands.resource import add_auth_token_to_kwargs_from_cli from st2client.formatters import table from st2client.models.keyvalue import KeyValue...
true
true
f7792901fa1137db1e0d11ba3264d842190bd21b
6,222
py
Python
web crawler functions/search_engine.py
akshaynagpal/python_web_crawler
a74af25db4c9f819105621868a6a9a7337a2a770
[ "MIT" ]
1
2022-03-06T21:00:45.000Z
2022-03-06T21:00:45.000Z
web crawler functions/search_engine.py
akshaynagpal/python_web_crawler
a74af25db4c9f819105621868a6a9a7337a2a770
[ "MIT" ]
null
null
null
web crawler functions/search_engine.py
akshaynagpal/python_web_crawler
a74af25db4c9f819105621868a6a9a7337a2a770
[ "MIT" ]
null
null
null
import urllib2 from bs4 import BeautifulSoup def crawl_web(seed): # returns index, graph of outlinks print "inside crawl_web" tocrawl = [seed] crawled = [] graph = {} # <url>:[list of pages it links to] index = {} while tocrawl: page = tocrawl.pop() if page not in crawled: ...
22.625455
129
0.624237
import urllib2 from bs4 import BeautifulSoup def crawl_web(seed): print "inside crawl_web" tocrawl = [seed] crawled = [] graph = {} index = {} while tocrawl: page = tocrawl.pop() if page not in crawled: content = get_page(page) c = BeautifulSoup(content...
false
true
f7792a540dac3b1d890e23b3308fc87545232bf0
501
py
Python
src/repositories/MongoDB/TeachersMongoDBRepository.py
claclacla/Fill-a-minimal-API-server-with-Flask-and-Celery-one-drop-at-a-time
28eb09ae3b54cc10e0a17a5b5400e0476ee01a81
[ "MIT" ]
null
null
null
src/repositories/MongoDB/TeachersMongoDBRepository.py
claclacla/Fill-a-minimal-API-server-with-Flask-and-Celery-one-drop-at-a-time
28eb09ae3b54cc10e0a17a5b5400e0476ee01a81
[ "MIT" ]
null
null
null
src/repositories/MongoDB/TeachersMongoDBRepository.py
claclacla/Fill-a-minimal-API-server-with-Flask-and-Celery-one-drop-at-a-time
28eb09ae3b54cc10e0a17a5b5400e0476ee01a81
[ "MIT" ]
null
null
null
from flask_pymongo import PyMongo class TeachersMongoDBRepository(): def __init__(self, application): self.mongo = PyMongo(application) def create(self, teacher): uid = self.mongo.db.teachers.insert_one({ "username": teacher.username, "password": teacher.password }).inserted_id teache...
25.05
81
0.726547
from flask_pymongo import PyMongo class TeachersMongoDBRepository(): def __init__(self, application): self.mongo = PyMongo(application) def create(self, teacher): uid = self.mongo.db.teachers.insert_one({ "username": teacher.username, "password": teacher.password }).inserted_id teache...
true
true
f7792b365a5d972e8fa5695c176e889c527e5b1b
2,165
py
Python
examples/MACD/macd_example.py
Treestanx/pylivetrader
7d3244e05996dae8a137ed257350783bdfbcf13d
[ "Apache-2.0" ]
2
2020-08-20T09:44:39.000Z
2020-10-20T22:45:49.000Z
examples/MACD/macd_example.py
Treestanx/pylivetrader
7d3244e05996dae8a137ed257350783bdfbcf13d
[ "Apache-2.0" ]
null
null
null
examples/MACD/macd_example.py
Treestanx/pylivetrader
7d3244e05996dae8a137ed257350783bdfbcf13d
[ "Apache-2.0" ]
1
2020-03-31T03:16:06.000Z
2020-03-31T03:16:06.000Z
from pylivetrader.api import order_target_percent, record, symbol import pandas as pd def initialize(context): # The initialize method is called at the very start of your script's # execution. You can set up anything you'll be needing later here. The # context argument will be received by all pylivetrader...
40.849057
78
0.703926
from pylivetrader.api import order_target_percent, record, symbol import pandas as pd def initialize(context): # execution. You can set up anything you'll be needing later here. The # share between methods. # This is the asset that we'll be trading. context.asset = symbol('AAPL') def ha...
true
true
f7792b3d2d37da43fdc2b725659e662fad2df492
149
py
Python
digits/dataset/images/generic/__init__.py
ojmakhura/DIGITS
f34e62c245054b51ea51fcb8949d2ca777f162d1
[ "BSD-3-Clause" ]
null
null
null
digits/dataset/images/generic/__init__.py
ojmakhura/DIGITS
f34e62c245054b51ea51fcb8949d2ca777f162d1
[ "BSD-3-Clause" ]
null
null
null
digits/dataset/images/generic/__init__.py
ojmakhura/DIGITS
f34e62c245054b51ea51fcb8949d2ca777f162d1
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. from .job import GenericImageDatasetJob __all__ = ['GenericImageDatasetJob']
21.285714
68
0.778523
from .job import GenericImageDatasetJob __all__ = ['GenericImageDatasetJob']
true
true
f7792bd681f9f279e785f6d6fa1a98e6f39d32d8
1,240
py
Python
carousel/tests/test_outputs.py
mikofski/FlyingCircus
77641afd6683db4ef1ba351b78fb80604a655609
[ "BSD-3-Clause" ]
2
2020-03-05T00:52:46.000Z
2021-05-12T02:29:29.000Z
carousel/tests/test_outputs.py
mikofski/FlyingCircus
77641afd6683db4ef1ba351b78fb80604a655609
[ "BSD-3-Clause" ]
null
null
null
carousel/tests/test_outputs.py
mikofski/FlyingCircus
77641afd6683db4ef1ba351b78fb80604a655609
[ "BSD-3-Clause" ]
null
null
null
""" test outputs """ from nose.tools import ok_, eq_ from carousel.core.outputs import Output from carousel.tests import PROJ_PATH import os def test_outputs_metaclass(): """ Test Output Sources """ class OutputTest1(Output): class Meta: outputs_file = 'pvpower.json' ...
30.243902
78
0.589516
from nose.tools import ok_, eq_ from carousel.core.outputs import Output from carousel.tests import PROJ_PATH import os def test_outputs_metaclass(): class OutputTest1(Output): class Meta: outputs_file = 'pvpower.json' outputs_path = os.path.join(PROJ_PATH, 'outputs') out_sr...
true
true
f7792c2bf65716c22d7c3fd6ed5eba76c0ddac74
10,803
py
Python
Thesis@3.9.1/Lib/site-packages/django/contrib/postgres/search.py
nverbois/TFE21-232
7113837b5263b5c508bfc6903cb6982b48aa7ee4
[ "MIT" ]
null
null
null
Thesis@3.9.1/Lib/site-packages/django/contrib/postgres/search.py
nverbois/TFE21-232
7113837b5263b5c508bfc6903cb6982b48aa7ee4
[ "MIT" ]
null
null
null
Thesis@3.9.1/Lib/site-packages/django/contrib/postgres/search.py
nverbois/TFE21-232
7113837b5263b5c508bfc6903cb6982b48aa7ee4
[ "MIT" ]
null
null
null
import psycopg2 from django.db.models import ( CharField, Expression, Field, FloatField, Func, Lookup, TextField, Value, ) from django.db.models.expressions import CombinedExpression from django.db.models.functions import Cast, Coalesce class SearchVectorExact(Lookup): lookup_name...
31.773529
87
0.605017
import psycopg2 from django.db.models import ( CharField, Expression, Field, FloatField, Func, Lookup, TextField, Value, ) from django.db.models.expressions import CombinedExpression from django.db.models.functions import Cast, Coalesce class SearchVectorExact(Lookup): lookup_name...
true
true
f7792c5de1b2e68dfaf333a0ef8439998cdac9a6
1,782
py
Python
fastreid/layers/norm_layers/conditional_instance_norm2d.py
SZLSP/reid2020NAIC
d0eaee768e0be606417a27ce5ea2b3071b5a9bc2
[ "Apache-2.0" ]
2
2021-05-12T13:36:46.000Z
2021-08-15T10:35:08.000Z
fastreid/layers/norm_layers/conditional_instance_norm2d.py
SZLSP/reid2020NAIC
d0eaee768e0be606417a27ce5ea2b3071b5a9bc2
[ "Apache-2.0" ]
1
2021-12-28T12:49:49.000Z
2021-12-28T12:49:49.000Z
fastreid/layers/norm_layers/conditional_instance_norm2d.py
SZLSP/reid2020NAIC
d0eaee768e0be606417a27ce5ea2b3071b5a9bc2
[ "Apache-2.0" ]
null
null
null
import torch import torch.nn as nn class ConditionalInstanceNorm2d(nn.Module): """Conditional Instance Normalization Parameters num_features – C from an expected input of size (N, C, H, W) num_classes – Number of classes in the datset. bias – if set to True, adds a bias term to the emb...
34.269231
102
0.593715
import torch import torch.nn as nn class ConditionalInstanceNorm2d(nn.Module): def __init__(self, num_features, num_classes, bias=True): super().__init__() self.num_features = num_features self.bias = bias self.instance_norm = nn.InstanceNorm2d(num_features, affine=False, track_ru...
true
true
f7792d2ee2dacb7553f7f4a553d69fad832d77cb
7,279
py
Python
dask_sql/physical/rel/custom/create_model.py
rapidsai/dask-sql
964e193bf259095a43b162e5d0052d059b8cdfe3
[ "MIT" ]
1
2022-02-08T19:08:48.000Z
2022-02-08T19:08:48.000Z
dask_sql/physical/rel/custom/create_model.py
rapidsai/dask-sql
964e193bf259095a43b162e5d0052d059b8cdfe3
[ "MIT" ]
8
2021-09-27T16:12:24.000Z
2022-01-05T19:25:30.000Z
dask_sql/physical/rel/custom/create_model.py
rapidsai/dask-sql
964e193bf259095a43b162e5d0052d059b8cdfe3
[ "MIT" ]
3
2021-10-05T13:50:47.000Z
2021-12-14T15:17:44.000Z
import logging from typing import TYPE_CHECKING from dask import delayed from nvtx import annotate from dask_sql.datacontainer import DataContainer from dask_sql.physical.rel.base import BaseRelPlugin from dask_sql.utils import convert_sql_kwargs, import_class if TYPE_CHECKING: import dask_sql from dask_sql....
37.520619
122
0.643632
import logging from typing import TYPE_CHECKING from dask import delayed from nvtx import annotate from dask_sql.datacontainer import DataContainer from dask_sql.physical.rel.base import BaseRelPlugin from dask_sql.utils import convert_sql_kwargs, import_class if TYPE_CHECKING: import dask_sql from dask_sql....
true
true
f7792e1626db50a1e695869c2a92beb2063c77de
2,047
py
Python
nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py
grlee77/nipype
73f3a733ac1b7d9b09ec32a387905a9302423b87
[ "BSD-3-Clause" ]
null
null
null
nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py
grlee77/nipype
73f3a733ac1b7d9b09ec32a387905a9302423b87
[ "BSD-3-Clause" ]
null
null
null
nipype/interfaces/mipav/tests/test_auto_JistLaminarVolumetricLayering.py
grlee77/nipype
73f3a733ac1b7d9b09ec32a387905a9302423b87
[ "BSD-3-Clause" ]
null
null
null
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from nipype.testing import assert_equal from nipype.interfaces.mipav.developer import JistLaminarVolumetricLayering def test_JistLaminarVolumetricLayering_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True...
27.662162
78
0.643381
from nipype.testing import assert_equal from nipype.interfaces.mipav.developer import JistLaminarVolumetricLayering def test_JistLaminarVolumetricLayering_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dict(nohash=True, us...
true
true
f7792eb52504b479eea55b8de7de95baa05e9041
2,653
py
Python
tests/helpers/test_device_registry.py
JariInc/home-assistant
24a8d60566fb5cf62942d042d38965a705d1bc65
[ "Apache-2.0" ]
null
null
null
tests/helpers/test_device_registry.py
JariInc/home-assistant
24a8d60566fb5cf62942d042d38965a705d1bc65
[ "Apache-2.0" ]
null
null
null
tests/helpers/test_device_registry.py
JariInc/home-assistant
24a8d60566fb5cf62942d042d38965a705d1bc65
[ "Apache-2.0" ]
null
null
null
"""Tests for the Device Registry.""" import pytest from homeassistant.helpers import device_registry def mock_registry(hass, mock_entries=None): """Mock the Device Registry.""" registry = device_registry.DeviceRegistry(hass) registry.devices = mock_entries or [] async def _get_reg(): return ...
31.963855
61
0.545043
import pytest from homeassistant.helpers import device_registry def mock_registry(hass, mock_entries=None): registry = device_registry.DeviceRegistry(hass) registry.devices = mock_entries or [] async def _get_reg(): return registry hass.data[device_registry.DATA_REGISTRY] = \ hass.l...
true
true
f7792f13b4a80878ba4233454f5d8db726c3ca07
11,253
py
Python
crypt_lstm.py
rahulbhadani/RNN
47c288ba9f2ed17a593e6b61d0d867cb2d69c244
[ "MIT" ]
null
null
null
crypt_lstm.py
rahulbhadani/RNN
47c288ba9f2ed17a593e6b61d0d867cb2d69c244
[ "MIT" ]
null
null
null
crypt_lstm.py
rahulbhadani/RNN
47c288ba9f2ed17a593e6b61d0d867cb2d69c244
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """Crypt_LSTM Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1guzTMibpzWywlckt9xu2gazsb-jifVDG """ import tensorflow as tf import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import...
36.3
106
0.701057
import tensorflow as tf import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.preprocessing import StandardScaler import io btc = pd.read_csv('/home/ivory/VersionControl/RNN/btc.csv') data_to_use = btc['Close'].values btc.head() data_to_use=btc['Close'].values data_to_use scaler = Sta...
true
true
f77931c3f955fbf0800dc4b1b6157af481c038ed
2,505
py
Python
scrape_mars.py
ktruong14/web_scraping_challenge
312714639ea4d3d6d5dcc265620aa0e6d4ea2d29
[ "ADSL" ]
null
null
null
scrape_mars.py
ktruong14/web_scraping_challenge
312714639ea4d3d6d5dcc265620aa0e6d4ea2d29
[ "ADSL" ]
null
null
null
scrape_mars.py
ktruong14/web_scraping_challenge
312714639ea4d3d6d5dcc265620aa0e6d4ea2d29
[ "ADSL" ]
null
null
null
from splinter import Browser from bs4 import BeautifulSoup import pandas as pd import time def init_browser(): executable_path = {'executable_path': 'chromedriver.exe'} browser = Browser('chrome', **executable_path, headless=False) return browser def marsNews(): browser = init_browser() url = 'h...
30.925926
96
0.676647
from splinter import Browser from bs4 import BeautifulSoup import pandas as pd import time def init_browser(): executable_path = {'executable_path': 'chromedriver.exe'} browser = Browser('chrome', **executable_path, headless=False) return browser def marsNews(): browser = init_browser() url = 'h...
true
true
f77931eecb5f43b773d9bcd469be60c0d5e515ff
879
py
Python
vivado/2017.2/module/PrependInit/sim/test/checkData.py
kino2718/InverceMatrixIp
0cf56d54ee663db69891a2f4835bde4d0e89bdd9
[ "MIT" ]
2
2017-08-06T23:44:26.000Z
2018-10-25T03:48:07.000Z
vivado/2017.2/module/PrependInit/sim/test/checkData.py
kino2718/InverceMatrixIP
0cf56d54ee663db69891a2f4835bde4d0e89bdd9
[ "MIT" ]
null
null
null
vivado/2017.2/module/PrependInit/sim/test/checkData.py
kino2718/InverceMatrixIP
0cf56d54ee663db69891a2f4835bde4d0e89bdd9
[ "MIT" ]
null
null
null
#! /usr/bin/env python3 fin = open('../../PrependInit/PrependInit.sim/sim_1/behav/result.txt', 'r') fref = open('ref.txt', 'r') line_no = 1 lin = fin.readline() ok = True while lin: # 結果を読み込む results = lin[:-1].split(' ') tdata = int(results[0], 16) # 比較する値を読み込み lref = fref.readline() if not...
19.977273
75
0.557452
fin = open('../../PrependInit/PrependInit.sim/sim_1/behav/result.txt', 'r') fref = open('ref.txt', 'r') line_no = 1 lin = fin.readline() ok = True while lin: results = lin[:-1].split(' ') tdata = int(results[0], 16) lref = fref.readline() if not lref: print("Error: too much output da...
true
true
f77931f5ea116c89f48ec5414ba3755693f716b7
5,750
py
Python
angle2bvh.py
snumrl/skate
a57ec2dc81dc2502da8886b92b870d2c8d65b838
[ "Apache-2.0" ]
null
null
null
angle2bvh.py
snumrl/skate
a57ec2dc81dc2502da8886b92b870d2c8d65b838
[ "Apache-2.0" ]
null
null
null
angle2bvh.py
snumrl/skate
a57ec2dc81dc2502da8886b92b870d2c8d65b838
[ "Apache-2.0" ]
null
null
null
import numpy as np from PyCommon.modules.Math import mmMath as mm import math import os import bvh from scipy.spatial.transform import Rotation class MakeBvh(object): def __init__(self): self.skel = None self.joint_name = None def angle2bvh(self): file_dir = 'data/mocap/movingcam/' ...
40.492958
112
0.480348
import numpy as np from PyCommon.modules.Math import mmMath as mm import math import os import bvh from scipy.spatial.transform import Rotation class MakeBvh(object): def __init__(self): self.skel = None self.joint_name = None def angle2bvh(self): file_dir = 'data/mocap/movingcam/' ...
true
true
f77933a04ceb8f52c71180b3fdd298eb761f4d72
396
py
Python
qap.py
keyvank/pyrove
94ba34bf9c4cd5db9ebec3a757416b095cc135ec
[ "MIT" ]
3
2019-09-15T18:04:12.000Z
2022-01-11T13:10:02.000Z
qap.py
keyvank/pyrove
94ba34bf9c4cd5db9ebec3a757416b095cc135ec
[ "MIT" ]
null
null
null
qap.py
keyvank/pyrove
94ba34bf9c4cd5db9ebec3a757416b095cc135ec
[ "MIT" ]
1
2021-01-26T02:56:38.000Z
2021-01-26T02:56:38.000Z
from polynomial import PolynomialP class QAP: def __init__(self, circuit): self.inputs = circuit.inputs self.L = [PolynomialP.interpolate(l) for l in list(zip(*circuit.L))] self.R = [PolynomialP.interpolate(r) for r in list(zip(*circuit.R))] self.O = [PolynomialP.interpolate(o) for...
36
76
0.65404
from polynomial import PolynomialP class QAP: def __init__(self, circuit): self.inputs = circuit.inputs self.L = [PolynomialP.interpolate(l) for l in list(zip(*circuit.L))] self.R = [PolynomialP.interpolate(r) for r in list(zip(*circuit.R))] self.O = [PolynomialP.interpolate(o) for...
true
true
f7793446f416aa11c94e00678bbf81abeaa272be
7,830
py
Python
src/python/turicreate/test/test_gl_pickler.py
cookingcodewithme/turicreate
a89e203d60529d2d72547c03ec9753ea979ee342
[ "BSD-3-Clause" ]
11,356
2017-12-08T19:42:32.000Z
2022-03-31T16:55:25.000Z
src/python/turicreate/test/test_gl_pickler.py
cookingcodewithme/turicreate
a89e203d60529d2d72547c03ec9753ea979ee342
[ "BSD-3-Clause" ]
2,402
2017-12-08T22:31:01.000Z
2022-03-28T19:25:52.000Z
src/python/turicreate/test/test_gl_pickler.py
cookingcodewithme/turicreate
a89e203d60529d2d72547c03ec9753ea979ee342
[ "BSD-3-Clause" ]
1,343
2017-12-08T19:47:19.000Z
2022-03-26T11:31:36.000Z
# -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause from __future__ import print_function as _ from __future__ import division as _ from...
31.071429
88
0.517369
from __future__ import print_function as _ from __future__ import division as _ from __future__ import absolute_import as _ import unittest import os import uuid import shutil import sys import pickle from turicreate.util import _cloudpickle import turicreate as tc from turicreate import _gl_pickle as gl_pickle from ...
true
true
f77935bc45ed2f298174089bf7b890fb4d5e8095
1,176
py
Python
examples/demo_sa.py
koralturkk/scikit-opt
3fe731460cb07d9892e220c0e47a2c6d8116e07c
[ "MIT" ]
7
2020-08-26T09:25:28.000Z
2022-02-28T11:33:57.000Z
examples/demo_sa.py
Timskt/scikit-opt
f62cd7f73d8b355f6d3d1865366794416268460b
[ "MIT" ]
null
null
null
examples/demo_sa.py
Timskt/scikit-opt
f62cd7f73d8b355f6d3d1865366794416268460b
[ "MIT" ]
1
2021-06-04T14:10:22.000Z
2021-06-04T14:10:22.000Z
demo_func = lambda x: x[0] ** 2 + (x[1] - 0.05) ** 2 + x[2] ** 2 # %% Do SA from sko.SA import SA sa = SA(func=demo_func, x0=[1, 1, 1], T_max=1, T_min=1e-9, L=300, max_stay_counter=150) best_x, best_y = sa.run() print('best_x:', best_x, 'best_y', best_y) # %% Plot the result import matplotlib.pyplot as plt import pa...
31.783784
114
0.69898
demo_func = lambda x: x[0] ** 2 + (x[1] - 0.05) ** 2 + x[2] ** 2 from sko.SA import SA sa = SA(func=demo_func, x0=[1, 1, 1], T_max=1, T_min=1e-9, L=300, max_stay_counter=150) best_x, best_y = sa.run() print('best_x:', best_x, 'best_y', best_y) import matplotlib.pyplot as plt import pandas as pd plt.plot(pd.DataFram...
true
true
f77936be83be016276e63709c7b7c72b6089d654
676
py
Python
departure/commons/helpers.py
Woll78/departure-python
86eccd40291ad560d5859a120dd6c99aa5c4bd12
[ "MIT" ]
4
2020-10-18T18:12:04.000Z
2022-03-31T19:13:08.000Z
departure/commons/helpers.py
Woll78/departure-python
86eccd40291ad560d5859a120dd6c99aa5c4bd12
[ "MIT" ]
null
null
null
departure/commons/helpers.py
Woll78/departure-python
86eccd40291ad560d5859a120dd6c99aa5c4bd12
[ "MIT" ]
1
2021-11-19T10:37:26.000Z
2021-11-19T10:37:26.000Z
def rchop(s, ending): return s[: -len(ending)] if s.endswith(ending) else s def lchop(s, beginning): return s[len(beginning) :] if s.startswith(beginning) else s def ordinal_en(n: int): # https://stackoverflow.com/questions/9647202/ordinal-numbers-replacement return f'{n}{"tsnrhtdd"[(n//10%10!=1)*(n...
23.310345
77
0.630178
def rchop(s, ending): return s[: -len(ending)] if s.endswith(ending) else s def lchop(s, beginning): return s[len(beginning) :] if s.startswith(beginning) else s def ordinal_en(n: int): return f'{n}{"tsnrhtdd"[(n//10%10!=1)*(n%10<4)*n%10::4]}' def ordinal_fr(n: int): if n == 1: return ...
true
true
f77937018bdfcda011a1753d65906a0e1f6b9b1a
1,799
py
Python
apps/commons/helpers.py
gene1wood/bugbro
7a4360b12bdd2a8a7a1c3509c1497c8c9b2d8aea
[ "BSD-3-Clause" ]
1
2019-05-12T14:24:36.000Z
2019-05-12T14:24:36.000Z
apps/commons/helpers.py
gene1wood/bugbro
7a4360b12bdd2a8a7a1c3509c1497c8c9b2d8aea
[ "BSD-3-Clause" ]
2
2019-02-17T17:31:26.000Z
2020-02-24T17:30:32.000Z
apps/commons/helpers.py
gene1wood/bugbro
7a4360b12bdd2a8a7a1c3509c1497c8c9b2d8aea
[ "BSD-3-Clause" ]
2
2019-03-28T03:42:45.000Z
2019-11-25T18:00:13.000Z
import cgi import datetime import urllib import urlparse from django.conf import settings from django.template import defaultfilters from django.utils.html import strip_tags from jingo import register import jinja2 from .urlresolvers import reverse # Yanking filters from Django. register.filter(strip_tags) registe...
26.072464
76
0.696498
import cgi import datetime import urllib import urlparse from django.conf import settings from django.template import defaultfilters from django.utils.html import strip_tags from jingo import register import jinja2 from .urlresolvers import reverse register.filter(strip_tags) register.filter(defaultfilters.timesin...
true
true
f77937d726b501074f059e3f6a3b04d845b55ae5
4,128
py
Python
test/functional/p2p_feefilter.py
mderasse/vericonomy
fcc74c006121ce55badc2feec349fdfc76d678d2
[ "MIT" ]
null
null
null
test/functional/p2p_feefilter.py
mderasse/vericonomy
fcc74c006121ce55badc2feec349fdfc76d678d2
[ "MIT" ]
null
null
null
test/functional/p2p_feefilter.py
mderasse/vericonomy
fcc74c006121ce55badc2feec349fdfc76d678d2
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2016-2019 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test processing of feefilter messages.""" from decimal import Decimal import time from test_framework...
39.314286
96
0.667878
from decimal import Decimal import time from test_framework.messages import MSG_TX, MSG_WTX, msg_feefilter from test_framework.mininode import mininode_lock, P2PInterface from test_framework.test_framework import BitcoinTestFramework def hashToHex(hash): return format(hash, '064x') def allInvsMatch(invsExpecte...
true
true
f77938ad79c63d7789ec6f17b44e1a2479ba406c
2,624
py
Python
Tests/test_trie.py
eoc21/biopython
c0f8db8f55a506837c320459957a0ce99b0618b6
[ "PostgreSQL" ]
3
2017-10-23T21:53:57.000Z
2019-09-23T05:14:12.000Z
Tests/test_trie.py
eoc21/biopython
c0f8db8f55a506837c320459957a0ce99b0618b6
[ "PostgreSQL" ]
null
null
null
Tests/test_trie.py
eoc21/biopython
c0f8db8f55a506837c320459957a0ce99b0618b6
[ "PostgreSQL" ]
6
2020-02-26T16:34:20.000Z
2020-03-04T15:34:00.000Z
#!/usr/bin/env python import StringIO from operator import truth from Bio import trie trieobj = trie.trie() trieobj["hello"] = 5 trieobj["he"] = 7 trieobj["hej"] = 9 trieobj["foo"] = "bar" k = trieobj.keys() k.sort() print k # ["foo", "he", "hej", "hello"] print trieobj["hello"] ...
25.72549
78
0.550305
import StringIO from operator import truth from Bio import trie trieobj = trie.trie() trieobj["hello"] = 5 trieobj["he"] = 7 trieobj["hej"] = 9 trieobj["foo"] = "bar" k = trieobj.keys() k.sort() print k print trieobj["hello"] print trieobj.get("bye") print trieobj.has_ke...
false
true
f77939181ec5ae8044888fd19af058ab1bb00157
410
py
Python
__init__.py
Jayich-Lab/jax
43aa6b0795349510737590d2039e17a48dd97cd0
[ "MIT" ]
3
2021-11-29T19:25:01.000Z
2022-01-30T07:43:51.000Z
__init__.py
Jayich-Lab/jax
43aa6b0795349510737590d2039e17a48dd97cd0
[ "MIT" ]
13
2021-10-07T09:15:57.000Z
2022-02-02T21:15:39.000Z
__init__.py
Jayich-Lab/jax
43aa6b0795349510737590d2039e17a48dd97cd0
[ "MIT" ]
null
null
null
from jax.base.applets.jax_applet import JaxApplet from jax.base.applets.real_time_plot_applet import RealTimePlotApplet from jax.base.environments.jax_environment import JaxEnvironment from jax.base.environments.sinara_environment import SinaraEnvironment from jax.base.experiments.jax_experiment import JaxExperiment fr...
51.25
70
0.880488
from jax.base.applets.jax_applet import JaxApplet from jax.base.applets.real_time_plot_applet import RealTimePlotApplet from jax.base.environments.jax_environment import JaxEnvironment from jax.base.environments.sinara_environment import SinaraEnvironment from jax.base.experiments.jax_experiment import JaxExperiment fr...
true
true
f7793a1109d5181235c187414e4df498e77f4be6
701
py
Python
symphony/cli/pyinventory/graphql/input/add_equipment.py
idoshveki/magma
8022267bd8b8d94913fbb9a0836880361d785446
[ "BSD-3-Clause" ]
null
null
null
symphony/cli/pyinventory/graphql/input/add_equipment.py
idoshveki/magma
8022267bd8b8d94913fbb9a0836880361d785446
[ "BSD-3-Clause" ]
10
2021-03-31T20:19:00.000Z
2022-02-19T07:09:57.000Z
symphony/cli/pyinventory/graphql/input/add_equipment.py
idoshveki/magma
8022267bd8b8d94913fbb9a0836880361d785446
[ "BSD-3-Clause" ]
3
2020-08-20T18:45:34.000Z
2020-08-20T20:18:42.000Z
#!/usr/bin/env python3 # @generated AUTOGENERATED file. Do not Change! from dataclasses import dataclass from datetime import datetime from functools import partial from gql.gql.datetime_utils import DATETIME_FIELD from numbers import Number from typing import Any, Callable, List, Mapping, Optional from dataclasses_j...
28.04
57
0.776034
from dataclasses import dataclass from datetime import datetime from functools import partial from gql.gql.datetime_utils import DATETIME_FIELD from numbers import Number from typing import Any, Callable, List, Mapping, Optional from dataclasses_json import DataClassJsonMixin from ..input.property import PropertyInp...
true
true
f7793a28a46b7910cb1bb57deb190ecf411dc9fd
2,318
py
Python
tests/test_activity.py
ggarrett13/rever
16b9345b94d38aedb570af426d7ae135f7d69c12
[ "BSD-3-Clause" ]
66
2017-11-28T03:25:15.000Z
2022-03-25T20:22:45.000Z
tests/test_activity.py
ggarrett13/rever
16b9345b94d38aedb570af426d7ae135f7d69c12
[ "BSD-3-Clause" ]
181
2017-11-11T20:48:26.000Z
2022-03-06T18:34:54.000Z
tests/test_activity.py
ggarrett13/rever
16b9345b94d38aedb570af426d7ae135f7d69c12
[ "BSD-3-Clause" ]
29
2018-01-08T18:44:42.000Z
2022-03-09T02:47:31.000Z
"""Tests the activity class and its operations.""" import os import builtins from rever import vcsutils from rever.activity import Activity, activity def do_tryptophan(): with open('tryptophan.txt', 'w') as f: f.write('5-HTP\n') vcsutils.track('tryptophan.txt') vcsutils.commit("seratonin") def...
29.717949
66
0.633305
import os import builtins from rever import vcsutils from rever.activity import Activity, activity def do_tryptophan(): with open('tryptophan.txt', 'w') as f: f.write('5-HTP\n') vcsutils.track('tryptophan.txt') vcsutils.commit("seratonin") def test_do_undo(gitrepo): logger = builtins._...
true
true
f7793b1ce721d16282c3121aac2f9c84a45f952b
1,247
py
Python
packages/mcvine/python/mcvine/cli/bash.py
mcvine/mcvine
42232534b0c6af729628009bed165cd7d833789d
[ "BSD-3-Clause" ]
5
2017-01-16T03:59:47.000Z
2020-06-23T02:54:19.000Z
packages/mcvine/python/mcvine/cli/bash.py
mcvine/mcvine
42232534b0c6af729628009bed165cd7d833789d
[ "BSD-3-Clause" ]
293
2015-10-29T17:45:52.000Z
2022-01-07T16:31:09.000Z
packages/mcvine/python/mcvine/cli/bash.py
mcvine/mcvine
42232534b0c6af729628009bed165cd7d833789d
[ "BSD-3-Clause" ]
1
2019-05-25T00:53:31.000Z
2019-05-25T00:53:31.000Z
# -*- Python -*- # # # Jiao Lin <jiao.lin@gmail.com> # from . import mcvine, click @mcvine.group() def bash(): return @bash.command() def complete(): "Instructions for bash complete support" print(""" To enable bash auto complete for mcvine command, run $ eval "$(_MCVINE_COMPLETE=source mcvine)" """) ...
21.5
80
0.660786
from . import mcvine, click @mcvine.group() def bash(): return @bash.command() def complete(): print(""" To enable bash auto complete for mcvine command, run $ eval "$(_MCVINE_COMPLETE=source mcvine)" """) return alias_help = """build bash aliases of long mcvine commands This command prints out the...
true
true
f7793b4f1fc2f5f635219a740eadec85994989ed
2,956
py
Python
util/get_data.py
yunyanxing/pairwise_xray_augmentation
057927cf247b3854e311fbdf52b74001175915d8
[ "BSD-3-Clause" ]
2
2020-01-24T00:02:03.000Z
2021-01-14T23:21:49.000Z
util/get_data.py
yunyanxing/pairwise_xray_augmentation
057927cf247b3854e311fbdf52b74001175915d8
[ "BSD-3-Clause" ]
2
2020-03-24T09:31:16.000Z
2021-04-20T20:11:40.000Z
util/get_data.py
yunyanxing/pairwise_xray_augmentation
057927cf247b3854e311fbdf52b74001175915d8
[ "BSD-3-Clause" ]
null
null
null
from __future__ import print_function import os import tarfile import requests from warnings import warn from zipfile import ZipFile from bs4 import BeautifulSoup from os.path import abspath, isdir, join, basename class GetData(object): """ Download CycleGAN or Pix2Pix Data. Args: technique : str One of:...
25.482759
85
0.690122
from __future__ import print_function import os import tarfile import requests from warnings import warn from zipfile import ZipFile from bs4 import BeautifulSoup from os.path import abspath, isdir, join, basename class GetData(object): def __init__(self, technique='cyclegan', verbose=True): url_dict = { 'pix2...
true
true
f7793d81d7de16f140960bf49c29d9f58947f552
12,006
py
Python
build/generate-opts.py
zhmx/cmongodriver
7a7084ecd4b9938f2daad683359e9efc94f3fcfb
[ "Apache-2.0" ]
null
null
null
build/generate-opts.py
zhmx/cmongodriver
7a7084ecd4b9938f2daad683359e9efc94f3fcfb
[ "Apache-2.0" ]
null
null
null
build/generate-opts.py
zhmx/cmongodriver
7a7084ecd4b9938f2daad683359e9efc94f3fcfb
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # # Copyright 2017-present MongoDB, Inc. # # 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 applicab...
34.011331
443
0.647176
from collections import OrderedDict from os.path import basename, dirname, join as joinpath, normpath import re from jinja2 import Environment, FileSystemLoader this_dir = dirname(__file__) template_dir = joinpath(this_dir, 'opts_templates') src_dir = normpath(joinpath(this_dir, '../src/libmongoc/src/mongoc')) doc...
true
true
f7793ee554d187180a09c20056052072eac23ba7
8,377
py
Python
src/baskerville/models/banjax_report_consumer.py
deflect-ca/baskerville
9659f4b39ab66fcf5329a4eccff15e97245b04f0
[ "CC-BY-4.0" ]
2
2021-12-03T11:26:38.000Z
2022-01-12T22:24:29.000Z
src/baskerville/models/banjax_report_consumer.py
deflect-ca/baskerville
9659f4b39ab66fcf5329a4eccff15e97245b04f0
[ "CC-BY-4.0" ]
3
2022-01-19T15:17:37.000Z
2022-03-22T04:55:22.000Z
src/baskerville/models/banjax_report_consumer.py
deflect-ca/baskerville
9659f4b39ab66fcf5329a4eccff15e97245b04f0
[ "CC-BY-4.0" ]
null
null
null
import datetime import threading import json from kafka import KafkaConsumer, KafkaProducer import time import logging import sys import types from baskerville.db import set_up_db from baskerville.models.config import KafkaConfig from baskerville.models.ip_cache import IPCache from baskerville.util.elastic_writer impo...
34.759336
108
0.594843
import datetime import threading import json from kafka import KafkaConsumer, KafkaProducer import time import logging import sys import types from baskerville.db import set_up_db from baskerville.models.config import KafkaConfig from baskerville.models.ip_cache import IPCache from baskerville.util.elastic_writer impo...
true
true
f7793ef9d4bfa83fb140594b39bf4cdd18c3ebbc
27,379
py
Python
a2c_ppo_acktr/model.py
liuandrew/training-rl-algo
ca56d65209de0bf88ac1e1db2269bb7daac4da47
[ "MIT" ]
null
null
null
a2c_ppo_acktr/model.py
liuandrew/training-rl-algo
ca56d65209de0bf88ac1e1db2269bb7daac4da47
[ "MIT" ]
null
null
null
a2c_ppo_acktr/model.py
liuandrew/training-rl-algo
ca56d65209de0bf88ac1e1db2269bb7daac4da47
[ "MIT" ]
null
null
null
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import gym from a2c_ppo_acktr.distributions import Bernoulli, Categorical, DiagGaussian from a2c_ppo_acktr.utils import init class Flatten(nn.Module): def forward(self, x): return x.view(x.size(0), -1) class Policy(nn...
38.835461
123
0.570766
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import gym from a2c_ppo_acktr.distributions import Bernoulli, Categorical, DiagGaussian from a2c_ppo_acktr.utils import init class Flatten(nn.Module): def forward(self, x): return x.view(x.size(0), -1) class Policy(nn...
true
true
f7793f46ceca5aa343a751eaef180fcc3fa1875b
4,008
py
Python
rlkit/launchers/conf.py
naomilwx/rlkit
d4514f89e4cef0a93a936c4f6b34b2099ae3a523
[ "MIT" ]
null
null
null
rlkit/launchers/conf.py
naomilwx/rlkit
d4514f89e4cef0a93a936c4f6b34b2099ae3a523
[ "MIT" ]
null
null
null
rlkit/launchers/conf.py
naomilwx/rlkit
d4514f89e4cef0a93a936c4f6b34b2099ae3a523
[ "MIT" ]
null
null
null
""" Copy this file to config.py and modify as needed. """ import os from os.path import join import rlkit """ `doodad.mount.MountLocal` by default ignores directories called "data" If you're going to rename this directory and use EC2, then change `doodad.mount.MountLocal.filter_dir` """ # The directory of the project,...
26.025974
87
0.627745
import os from os.path import join import rlkit rlkit_project_dir = join(os.path.dirname(rlkit.__file__), os.pardir) LOCAL_LOG_DIR = join(rlkit_project_dir, 'data') CODE_DIRS_TO_MOUNT = [ rlkit_project_dir, ] HOME = os.getenv('HOME') if os.getenv('HOME') is not None else os.getenv("USERPROFILE") DIR_AND_MO...
true
true
f7793f97674c768af1004d32052926ff63fc89ca
2,845
py
Python
meeting/hooks.py
Himanshree/Meeting
4b593c9fd03abefada40051b69017d07dbcc17d2
[ "MIT" ]
null
null
null
meeting/hooks.py
Himanshree/Meeting
4b593c9fd03abefada40051b69017d07dbcc17d2
[ "MIT" ]
null
null
null
meeting/hooks.py
Himanshree/Meeting
4b593c9fd03abefada40051b69017d07dbcc17d2
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from . import __version__ as app_version app_name = "meeting" app_title = "Meeting" app_publisher = "Frappe" app_description = "meeting details" app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "himan@gmail.com" app_license = "MI...
22.054264
78
0.663972
from __future__ import unicode_literals from . import __version__ as app_version app_name = "meeting" app_title = "Meeting" app_publisher = "Frappe" app_description = "meeting details" app_icon = "octicon octicon-file-directory" app_color = "grey" app_email = "himan@gmail.com" app_license = "MIT" do...
true
true
f7793fface9b4cf7a61c6404db021995bac6a276
3,010
py
Python
cercanias/cercanias/settings.py
jorgeas80/cercanias-scrapper
80496e36db08314e4d48791e54154dcca54da4ba
[ "MIT" ]
null
null
null
cercanias/cercanias/settings.py
jorgeas80/cercanias-scrapper
80496e36db08314e4d48791e54154dcca54da4ba
[ "MIT" ]
null
null
null
cercanias/cercanias/settings.py
jorgeas80/cercanias-scrapper
80496e36db08314e4d48791e54154dcca54da4ba
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # Scrapy settings for cercanias project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # http://doc.scrapy.org/en/latest/topics/settings.html # http://scrapy.readthedocs.org/en/late...
35
109
0.786379
BOT_NAME = 'cercanias' SPIDER_MODULES = ['cercanias.spiders'] NEWSPIDER_MODULE = 'cercanias.spiders' ITEM_PIPELINES = { 'cercanias.pipelines.MongoPipeline': 300, }
true
true
f77940b583d578eb29ddb047467686df86a627aa
680
py
Python
oops_fhir/r4/value_set/device_safety.py
Mikuana/oops_fhir
77963315d123756b7d21ae881f433778096a1d25
[ "MIT" ]
null
null
null
oops_fhir/r4/value_set/device_safety.py
Mikuana/oops_fhir
77963315d123756b7d21ae881f433778096a1d25
[ "MIT" ]
null
null
null
oops_fhir/r4/value_set/device_safety.py
Mikuana/oops_fhir
77963315d123756b7d21ae881f433778096a1d25
[ "MIT" ]
null
null
null
from pathlib import Path from fhir.resources.valueset import ValueSet as _ValueSet from oops_fhir.utils import ValueSet __all__ = ["DeviceSafety"] _resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json")) class DeviceSafety(ValueSet): """ Device safety Codes used to identify medical devi...
21.25
72
0.726471
from pathlib import Path from fhir.resources.valueset import ValueSet as _ValueSet from oops_fhir.utils import ValueSet __all__ = ["DeviceSafety"] _resource = _ValueSet.parse_file(Path(__file__).with_suffix(".json")) class DeviceSafety(ValueSet): pass class Meta: resource = _resource
true
true