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
1c3c35218d2c88b973ab6e73fd319baf9b30cd97
5,599
py
Python
domainbed/lib/misc.py
abhimanyudubey/DomainBed
5c8373e40a04035081937b0fa3eb4fa5339dae32
[ "MIT" ]
6
2021-08-05T11:50:34.000Z
2022-02-28T15:29:09.000Z
domainbed/lib/misc.py
abhimanyudubey/DomainBed
5c8373e40a04035081937b0fa3eb4fa5339dae32
[ "MIT" ]
null
null
null
domainbed/lib/misc.py
abhimanyudubey/DomainBed
5c8373e40a04035081937b0fa3eb4fa5339dae32
[ "MIT" ]
1
2021-09-30T12:25:07.000Z
2021-09-30T12:25:07.000Z
""" Things that don't belong anywhere else """ import hashlib import json import os import sys from shutil import copyfile from collections import OrderedDict from numbers import Number import operator import numpy as np import torch import tqdm from collections import Counter import torch.nn.functional as F def cr...
27.312195
88
0.607609
import hashlib import json import os import sys from shutil import copyfile from collections import OrderedDict from numbers import Number import operator import numpy as np import torch import tqdm from collections import Counter import torch.nn.functional as F def cross_entropy(x, y): if len(y.shape) == 1: ...
true
true
1c3c359251e5128a884e99005c1729a6573be909
288
py
Python
django_project/sunlumo_project/forms.py
icrni/sunlumo
69f730d5adc42b71a24bcf27f1b8494b8d5dcec0
[ "MIT" ]
null
null
null
django_project/sunlumo_project/forms.py
icrni/sunlumo
69f730d5adc42b71a24bcf27f1b8494b8d5dcec0
[ "MIT" ]
null
null
null
django_project/sunlumo_project/forms.py
icrni/sunlumo
69f730d5adc42b71a24bcf27f1b8494b8d5dcec0
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- import logging LOG = logging.getLogger(__name__) import django.forms as forms # class aModelForm(forms.ModelForm): # class Meta: # model = aModel # def __init__(self, *args, **kwargs): # super(aModelForm, self).__init__(*args, **kwargs)
22.153846
59
0.642361
import logging LOG = logging.getLogger(__name__) import django.forms as forms
true
true
1c3c360f4d51e9c6d43ade8a7cacfd7f42b5ec98
7,730
py
Python
facebook_sdk/facebook.py
zetahernandez/facebook-py-sdk
ab41452b884592f3330336d173fe99491979e1b8
[ "MIT" ]
17
2017-09-29T20:14:36.000Z
2018-12-19T19:57:01.000Z
facebook_sdk/facebook.py
zetahernandez/facebook-py-sdk
ab41452b884592f3330336d173fe99491979e1b8
[ "MIT" ]
18
2017-10-10T14:20:31.000Z
2020-10-15T17:06:50.000Z
facebook_sdk/facebook.py
zetahernandez/facebook-py-sdk
ab41452b884592f3330336d173fe99491979e1b8
[ "MIT" ]
10
2017-10-31T22:59:49.000Z
2021-09-08T11:22:16.000Z
import os from typing import ( # noqa: F401 TYPE_CHECKING, Any, Dict, Iterable, Mapping, Optional, Text, Tuple, Type, Union, cast, ) from facebook_sdk.authentication import ( AccessToken, OAuth2Client, ) from facebook_sdk.client import FacebookClient from facebook_...
31.942149
98
0.607245
import os from typing import ( TYPE_CHECKING, Any, Dict, Iterable, Mapping, Optional, Text, Tuple, Type, Union, cast, ) from facebook_sdk.authentication import ( AccessToken, OAuth2Client, ) from facebook_sdk.client import FacebookClient from facebook_sdk.constant...
true
true
1c3c36f7f5a69f28c0e93864a87e86921ab7416d
837
py
Python
example/test/test_usestep.py
steven004/pytest_oot
d8267e08191632ba32f0ce84ff0abad8fd842a3d
[ "MIT" ]
2
2015-04-23T07:23:15.000Z
2020-02-26T16:54:25.000Z
example/test/test_usestep.py
steven004/pytest_oot
d8267e08191632ba32f0ce84ff0abad8fd842a3d
[ "MIT" ]
3
2015-01-20T02:04:13.000Z
2016-09-19T03:14:26.000Z
example/test/test_usestep.py
steven004/pytest_oot
d8267e08191632ba32f0ce84ff0abad8fd842a3d
[ "MIT" ]
1
2018-03-05T17:30:16.000Z
2018-03-05T17:30:16.000Z
__author__ = 'Steven LI' from .testbed import * from test_steps import * def test_NumBase_add_mulple(): step("num1.add(3,4,5,6) == 23") step("num1.multiple(2,4,5) == 200") step("num4.add(3,4,5,6) == 23") def test_NumBase_add_multiple2(): steps(''' num1.add(3,4,5,6) == 23 num1.multiple...
23.25
48
0.532855
__author__ = 'Steven LI' from .testbed import * from test_steps import * def test_NumBase_add_mulple(): step("num1.add(3,4,5,6) == 23") step("num1.multiple(2,4,5) == 200") step("num4.add(3,4,5,6) == 23") def test_NumBase_add_multiple2(): steps(''' num1.add(3,4,5,6) == 23 num1.multiple...
true
true
1c3c36f80c202066ee6e4861d511ce5139939c29
7,701
py
Python
dahua.py
d34db33f-1007/asleep_scanner
7fe03adad8335ce306ae2b7b933d8142205bd8c3
[ "Apache-2.0" ]
46
2020-04-15T12:03:24.000Z
2022-03-22T04:39:16.000Z
dahua.py
S0Ulle33/asleep_scanner
7fe03adad8335ce306ae2b7b933d8142205bd8c3
[ "Apache-2.0" ]
9
2020-06-14T19:51:04.000Z
2022-03-08T12:25:04.000Z
dahua.py
S0Ulle33/asleep_scanner
7fe03adad8335ce306ae2b7b933d8142205bd8c3
[ "Apache-2.0" ]
31
2020-06-15T09:35:17.000Z
2022-03-28T22:54:02.000Z
#!/usr/bin/env python3 # -*- coding:utf-8 -*- import logging import re import socket import struct import time from enum import Enum #import telegram #from wrapt_timeout_decorator import * LOGIN_TEMPLATE = b'\xa0\x00\x00\x60%b\x00\x00\x00%b%b%b%b\x04\x01\x00\x00\x00\x00\xa1\xaa%b&&%b\x00Random:%b\r\n\r\n' GET_SERIA...
48.13125
1,572
0.595507
import logging import re import socket import struct import time from enum import Enum LOGIN_TEMPLATE = b'\xa0\x00\x00\x60%b\x00\x00\x00%b%b%b%b\x04\x01\x00\x00\x00\x00\xa1\xaa%b&&%b\x00Random:%b\r\n\r\n' GET_SERIAL = b'\xa4\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00...
true
true
1c3c393ffe7073b18db0519cff362aef565702eb
8,981
py
Python
rssynergia/base_diagnostics/step_diagnostic.py
radiasoft/rs_synergia
b43509de7f4a938354dc127762d8e723463e0e95
[ "Apache-2.0" ]
null
null
null
rssynergia/base_diagnostics/step_diagnostic.py
radiasoft/rs_synergia
b43509de7f4a938354dc127762d8e723463e0e95
[ "Apache-2.0" ]
null
null
null
rssynergia/base_diagnostics/step_diagnostic.py
radiasoft/rs_synergia
b43509de7f4a938354dc127762d8e723463e0e95
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """? :copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved. :license: http://www.apache.org/licenses/LICENSE-2.0.html """ from __future__ import absolute_import, division, print_function import synergia import os import numpy as np import h5py as h5 from mpi4py import MPI comm_wor...
42.563981
119
0.613183
from __future__ import absolute_import, division, print_function import synergia import os import numpy as np import h5py as h5 from mpi4py import MPI comm_world = MPI.COMM_WORLD try: import __builtin__ except ImportError: import builtins as __builtin__ my_rank = comm_world.rank def print(*args, **kwa...
true
true
1c3c3a246b808ce6cfc008ff2deb745737b043b8
13,005
py
Python
src/DistPCAE.py
spaghettix/DissP_RL_OCTSC
e03df1ebc5c3ccef66ddf7cd2b05d0106855215f
[ "MIT" ]
null
null
null
src/DistPCAE.py
spaghettix/DissP_RL_OCTSC
e03df1ebc5c3ccef66ddf7cd2b05d0106855215f
[ "MIT" ]
null
null
null
src/DistPCAE.py
spaghettix/DissP_RL_OCTSC
e03df1ebc5c3ccef66ddf7cd2b05d0106855215f
[ "MIT" ]
null
null
null
""" ABOUT: DISTANCE PRESERVING CONVOLUTIONAL AUTO-ENCODER for UNIVARIATE TIME SERIES. """ __author__ = 'Stefano Mauceri' __email__ = 'mauceri.stefano@gmail.com' # ============================================================================= # IMPORT # =====================================================...
34.313984
217
0.476125
__author__ = 'Stefano Mauceri' __email__ = 'mauceri.stefano@gmail.com' import numpy as np import tensorflow as tf tf.keras.backend.set_floatx('float32') try: from .nn_utils import AEBase, LossHistory except: from nn_utils import AEBase, LossHistory from tensorflow.keras import Model, Sequential fr...
true
true
1c3c3a7101cd5304cab7ddc2c15045fb5d973ec2
3,596
py
Python
gui/accounts/utils.py
klebed/esdc-ce
2c9e4591f344247d345a83880ba86777bb794460
[ "Apache-2.0" ]
97
2016-11-15T14:44:23.000Z
2022-03-13T18:09:15.000Z
gui/accounts/utils.py
klebed/esdc-ce
2c9e4591f344247d345a83880ba86777bb794460
[ "Apache-2.0" ]
334
2016-11-17T19:56:57.000Z
2022-03-18T10:45:53.000Z
gui/accounts/utils.py
klebed/esdc-ce
2c9e4591f344247d345a83880ba86777bb794460
[ "Apache-2.0" ]
33
2017-01-02T16:04:13.000Z
2022-02-07T19:20:24.000Z
from django.contrib.gis.geoip import GeoIP from django.utils.translation import get_language from django.core.cache import cache from logging import getLogger # noinspection PyProtectedMember from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE from pytz import country_timezones logger = getLogger(__name__) d...
27.661538
107
0.675473
from django.contrib.gis.geoip import GeoIP from django.utils.translation import get_language from django.core.cache import cache from logging import getLogger from phonenumbers.data import _COUNTRY_CODE_TO_REGION_CODE from pytz import country_timezones logger = getLogger(__name__) def get_client_ip(request): x...
true
true
1c3c3ae895ac2f9f08901e9629374a47b3329275
4,593
py
Python
1-Chainlet/rewrite_from_java/FeatureExtractor.py
wang-yuhao/On-the-topological-propertyof-dynamic-transaction-graph
8dc8c3870befb82581099e3a6edc9f9734c23f31
[ "MIT" ]
1
2021-01-13T20:54:18.000Z
2021-01-13T20:54:18.000Z
1-Chainlet/rewrite_from_java/FeatureExtractor.py
wang-yuhao/On-the-topological-propertyof-dynamic-transaction-graph
8dc8c3870befb82581099e3a6edc9f9734c23f31
[ "MIT" ]
null
null
null
1-Chainlet/rewrite_from_java/FeatureExtractor.py
wang-yuhao/On-the-topological-propertyof-dynamic-transaction-graph
8dc8c3870befb82581099e3a6edc9f9734c23f31
[ "MIT" ]
1
2020-12-03T10:30:53.000Z
2020-12-03T10:30:53.000Z
class FeatureExtractor: def __init__(self): preprocess = False data_dir = "H:/data/createddata/feature/" os.mkdirs(data_dir) years = {2016, 2017} for year in years: splitFiles(year) print("year\tday\tmeanValue\tmedianValue\thoMedian\tmean...
41.754545
221
0.406924
class FeatureExtractor: def __init__(self): preprocess = False data_dir = "H:/data/createddata/feature/" os.mkdirs(data_dir) years = {2016, 2017} for year in years: splitFiles(year) print("year\tday\tmeanValue\tmedianValue\thoMedian\tmean...
true
true
1c3c3b9273adc651b96a12e16847078408e659b1
799
py
Python
tests/conftest.py
owlint/Portainer2Git
fa5592ce75a9e312b6b4763b18b2d8b3b419333f
[ "Apache-2.0" ]
1
2020-05-03T14:00:46.000Z
2020-05-03T14:00:46.000Z
tests/conftest.py
lauevrar77/Portainer2Git
fa5592ce75a9e312b6b4763b18b2d8b3b419333f
[ "Apache-2.0" ]
null
null
null
tests/conftest.py
lauevrar77/Portainer2Git
fa5592ce75a9e312b6b4763b18b2d8b3b419333f
[ "Apache-2.0" ]
null
null
null
import mongomock import pymongo import sys from unittest.mock import MagicMock client = mongomock.MongoClient() mock = MagicMock() sys.modules["pymongo"] = mock mock.MongoClient = MagicMock(return_value=client) mock.ASCENDING = pymongo.ASCENDING mock.DESCENDING = pymongo.DESCENDING from infrastructure.persistance.pe...
25.774194
74
0.822278
import mongomock import pymongo import sys from unittest.mock import MagicMock client = mongomock.MongoClient() mock = MagicMock() sys.modules["pymongo"] = mock mock.MongoClient = MagicMock(return_value=client) mock.ASCENDING = pymongo.ASCENDING mock.DESCENDING = pymongo.DESCENDING from infrastructure.persistance.pe...
true
true
1c3c3c3f5de7ac97e3100fb5bc9489bb547d89ef
8,851
py
Python
TrainingExtensions/common/src/python/aimet_common/cache.py
lipovsek/aimet
236fb02cc6c45e65c067030416c49a09ace82045
[ "BSD-3-Clause" ]
null
null
null
TrainingExtensions/common/src/python/aimet_common/cache.py
lipovsek/aimet
236fb02cc6c45e65c067030416c49a09ace82045
[ "BSD-3-Clause" ]
null
null
null
TrainingExtensions/common/src/python/aimet_common/cache.py
lipovsek/aimet
236fb02cc6c45e65c067030416c49a09ace82045
[ "BSD-3-Clause" ]
null
null
null
# /usr/bin/env python3.6 # -*- mode: python -*- # ============================================================================= # @@-COPYRIGHT-START-@@ # # Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification,...
40.231818
98
0.650322
import abc import contextlib import functools import os import pickle from typing import Any, Callable, Optional, Generic, TypeVar from aimet_common.utils import AimetLogger _logger = AimetLogger.get_area_logger(AimetLogger.LogAreas.Utils) class CacheMiss(FileNotFoundError): ...
true
true
1c3c3c9d896f02485afef951ea488800262d55bd
126
py
Python
seahub/related_files/apps.py
weimens/seahub
5ecf78ed7a2ddc72a23961804ee41be21c24893f
[ "Apache-2.0" ]
101
2021-05-16T06:00:03.000Z
2021-12-01T02:02:29.000Z
seahub/related_files/apps.py
weimens/seahub
5ecf78ed7a2ddc72a23961804ee41be21c24893f
[ "Apache-2.0" ]
null
null
null
seahub/related_files/apps.py
weimens/seahub
5ecf78ed7a2ddc72a23961804ee41be21c24893f
[ "Apache-2.0" ]
2
2021-10-19T05:22:40.000Z
2022-01-12T03:55:34.000Z
# -*- coding: utf-8 -*- from django.apps import AppConfig class RelatedFilesConfig(AppConfig): name = 'related_files'
14
36
0.698413
from django.apps import AppConfig class RelatedFilesConfig(AppConfig): name = 'related_files'
true
true
1c3c3e20835e09ab095ea418937d485023f797ef
1,193
py
Python
git_project_updater_cli/commands/command.py
Slidem/git-project-updater
2d0e91fab26f6c5e7cf5c92c9f0ee78925fb33b5
[ "MIT" ]
null
null
null
git_project_updater_cli/commands/command.py
Slidem/git-project-updater
2d0e91fab26f6c5e7cf5c92c9f0ee78925fb33b5
[ "MIT" ]
null
null
null
git_project_updater_cli/commands/command.py
Slidem/git-project-updater
2d0e91fab26f6c5e7cf5c92c9f0ee78925fb33b5
[ "MIT" ]
null
null
null
from abc import ABC, abstractmethod from git_project_updater_business.settings.settings_repository import SettingsRepository from git_project_updater_business.repository.projects_repository import ProjectsRepository from git_project_updater_business.service.projects_service import ProjectsService from git_project_upda...
29.825
102
0.789606
from abc import ABC, abstractmethod from git_project_updater_business.settings.settings_repository import SettingsRepository from git_project_updater_business.repository.projects_repository import ProjectsRepository from git_project_updater_business.service.projects_service import ProjectsService from git_project_upda...
true
true
1c3c3e4d6c7215503da9378d3ae5a54d41ecbbdf
14,540
py
Python
pywgrib2_xr/template.py
yt87/pywgrib2_xr
5c49eaaee12948ecc2f2aff526a9e51e6d4d98b5
[ "0BSD" ]
11
2021-01-05T03:26:51.000Z
2022-02-15T02:44:39.000Z
pywgrib2_xr/template.py
yt87/pywgrib2_xr
5c49eaaee12948ecc2f2aff526a9e51e6d4d98b5
[ "0BSD" ]
2
2020-12-18T02:35:08.000Z
2021-07-11T13:01:53.000Z
pywgrib2_xr/template.py
yt87/pywgrib2_xr
5c49eaaee12948ecc2f2aff526a9e51e6d4d98b5
[ "0BSD" ]
null
null
null
from datetime import datetime, timedelta from functools import partial from typing import ( Any, Callable, Dict, List, NamedTuple, Optional, Sequence, Set, Tuple, ) # For older Pythons try: from typing import TypedDict except ImportError: from mypy_extensions import TypedDic...
33.425287
91
0.574415
from datetime import datetime, timedelta from functools import partial from typing import ( Any, Callable, Dict, List, NamedTuple, Optional, Sequence, Set, Tuple, ) try: from typing import TypedDict except ImportError: from mypy_extensions import TypedDict try: from nu...
true
true
1c3c3f457bc93c4d38f911ff7c9e924cbda143ee
5,918
py
Python
dvc/command/run.py
drorata/dvc
b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0
[ "Apache-2.0" ]
1
2019-09-02T00:28:11.000Z
2019-09-02T00:28:11.000Z
dvc/command/run.py
drorata/dvc
b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0
[ "Apache-2.0" ]
null
null
null
dvc/command/run.py
drorata/dvc
b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0
[ "Apache-2.0" ]
1
2019-09-02T00:29:40.000Z
2019-09-02T00:29:40.000Z
from __future__ import unicode_literals import argparse import logging from dvc.command.base import CmdBase, append_doc_link from dvc.exceptions import DvcException logger = logging.getLogger(__name__) class CmdRun(CmdBase): def run(self): overwrite = self.args.yes or self.args.overwrite_dvcfile ...
30.193878
79
0.562521
from __future__ import unicode_literals import argparse import logging from dvc.command.base import CmdBase, append_doc_link from dvc.exceptions import DvcException logger = logging.getLogger(__name__) class CmdRun(CmdBase): def run(self): overwrite = self.args.yes or self.args.overwrite_dvcfile ...
true
true
1c3c3fcd52cb384d3372de0dcc9572583ec10286
326
py
Python
tests/helpers/mock_logger.py
enamrik/krogon
a41a10ed346b7198509929ed9ba1e9fcf778dc78
[ "MIT" ]
1
2020-03-02T14:17:02.000Z
2020-03-02T14:17:02.000Z
tests/helpers/mock_logger.py
enamrik/krogon
a41a10ed346b7198509929ed9ba1e9fcf778dc78
[ "MIT" ]
null
null
null
tests/helpers/mock_logger.py
enamrik/krogon
a41a10ed346b7198509929ed9ba1e9fcf778dc78
[ "MIT" ]
null
null
null
from unittest.mock import Mock, MagicMock from krogon.logger import Logger class MockLogger: def __init__(self): logger = Mock(spec=Logger) logger.add_prefix = MagicMock(name='add_prefix', return_value=logger) self.logger = Logger(name="test") def get_mock(self): return self.l...
25.076923
77
0.690184
from unittest.mock import Mock, MagicMock from krogon.logger import Logger class MockLogger: def __init__(self): logger = Mock(spec=Logger) logger.add_prefix = MagicMock(name='add_prefix', return_value=logger) self.logger = Logger(name="test") def get_mock(self): return self.l...
true
true
1c3c416ed103d0d951f698f0dbd413fda6dbcb3a
6,939
py
Python
dataset_preprocessing/preprocess_h36m.py
akashsengupta1997/ProHMR
7015a3d070c79b4571d43abdf5e522468091a94d
[ "BSD-3-Clause" ]
120
2021-08-27T23:21:17.000Z
2022-03-30T03:34:07.000Z
dataset_preprocessing/preprocess_h36m.py
akashsengupta1997/ProHMR
7015a3d070c79b4571d43abdf5e522468091a94d
[ "BSD-3-Clause" ]
17
2021-09-08T10:10:37.000Z
2022-03-17T02:40:21.000Z
dataset_preprocessing/preprocess_h36m.py
akashsengupta1997/ProHMR
7015a3d070c79b4571d43abdf5e522468091a94d
[ "BSD-3-Clause" ]
10
2021-08-31T06:08:49.000Z
2022-03-29T21:51:14.000Z
import os import sys import cv2 import glob import h5py import numpy as np import argparse from spacepy import pycdf import pickle from prohmr.configs import prohmr_config, dataset_config parser = argparse.ArgumentParser(description='Generate H36M dataset files') parser.add_argument('--split', type=str, required=True...
39.87931
140
0.555556
import os import sys import cv2 import glob import h5py import numpy as np import argparse from spacepy import pycdf import pickle from prohmr.configs import prohmr_config, dataset_config parser = argparse.ArgumentParser(description='Generate H36M dataset files') parser.add_argument('--split', type=str, required=True...
true
true
1c3c4280efae7a8b28a6d112d58598efe7e727b5
4,560
py
Python
src/day8.py
dsimon96/AdventOfCode2021
9a538181b3c477cd0f360ce410d31fa7180db3b7
[ "MIT" ]
null
null
null
src/day8.py
dsimon96/AdventOfCode2021
9a538181b3c477cd0f360ce410d31fa7180db3b7
[ "MIT" ]
null
null
null
src/day8.py
dsimon96/AdventOfCode2021
9a538181b3c477cd0f360ce410d31fa7180db3b7
[ "MIT" ]
null
null
null
from typing import Generator, Iterable, TextIO import sys import click from collections import defaultdict from dataclasses import dataclass from enum import Enum, auto @click.group() def main(): pass class Segment(Enum): T = auto() M = auto() B = auto() UL = auto() UR = auto() LL = auto() ...
27.142857
77
0.635526
from typing import Generator, Iterable, TextIO import sys import click from collections import defaultdict from dataclasses import dataclass from enum import Enum, auto @click.group() def main(): pass class Segment(Enum): T = auto() M = auto() B = auto() UL = auto() UR = auto() LL = auto() ...
true
true
1c3c443fbc770e278b41fd2f337cd4dd0b1ae13e
3,676
py
Python
rlcard/envs/leducholdem.py
thomasthechen/rlcard
0139d0e403b6d844a8f9107237887d73c7e8d752
[ "MIT" ]
null
null
null
rlcard/envs/leducholdem.py
thomasthechen/rlcard
0139d0e403b6d844a8f9107237887d73c7e8d752
[ "MIT" ]
null
null
null
rlcard/envs/leducholdem.py
thomasthechen/rlcard
0139d0e403b6d844a8f9107237887d73c7e8d752
[ "MIT" ]
null
null
null
import json import os import numpy as np import rlcard from rlcard.envs import Env from rlcard.games.leducholdem import Game from rlcard.utils import * from rlcard import models class LeducholdemEnv(Env): ''' Leduc Hold'em Environment ''' def __init__(self, config): ''' Initialize the Limitholde...
31.689655
104
0.612078
import json import os import numpy as np import rlcard from rlcard.envs import Env from rlcard.games.leducholdem import Game from rlcard.utils import * from rlcard import models class LeducholdemEnv(Env): def __init__(self, config): self.game = Game() super().__init__(config) self.action...
true
true
1c3c447d3a1075c907b25e2e2f2d4593cff8548d
417
py
Python
plugins/keepkey/cmdline.py
BTCPrivate/electrum-bitcoinprivate
d18dbd83353d006136bc986e143e19dbb954c36a
[ "MIT" ]
1
2021-04-02T20:35:15.000Z
2021-04-02T20:35:15.000Z
plugins/keepkey/cmdline.py
ArdeshirV/electrum-bitcoinprivate
d18dbd83353d006136bc986e143e19dbb954c36a
[ "MIT" ]
null
null
null
plugins/keepkey/cmdline.py
ArdeshirV/electrum-bitcoinprivate
d18dbd83353d006136bc986e143e19dbb954c36a
[ "MIT" ]
1
2021-04-06T18:34:31.000Z
2021-04-06T18:34:31.000Z
from electrum_bitcoinprivate.plugins import hook from .keepkey import KeepKeyPlugin from ..hw_wallet import CmdLineHandler class Plugin(KeepKeyPlugin): handler = CmdLineHandler() @hook def init_keystore(self, keystore): if not isinstance(keystore, self.keystore_class): return ke...
27.8
57
0.721823
from electrum_bitcoinprivate.plugins import hook from .keepkey import KeepKeyPlugin from ..hw_wallet import CmdLineHandler class Plugin(KeepKeyPlugin): handler = CmdLineHandler() @hook def init_keystore(self, keystore): if not isinstance(keystore, self.keystore_class): return ke...
true
true
1c3c452c359788e2fcf75c6cbd76e2dd7b62dbf3
592
py
Python
ObjectDetection/scripts/utils/beewatch_backgroundsubstraction_adv.py
GLopezMUZH/bee_tracking_NN
0007e9a0749bfea3e74c997553059b6931ed6de8
[ "MIT" ]
null
null
null
ObjectDetection/scripts/utils/beewatch_backgroundsubstraction_adv.py
GLopezMUZH/bee_tracking_NN
0007e9a0749bfea3e74c997553059b6931ed6de8
[ "MIT" ]
null
null
null
ObjectDetection/scripts/utils/beewatch_backgroundsubstraction_adv.py
GLopezMUZH/bee_tracking_NN
0007e9a0749bfea3e74c997553059b6931ed6de8
[ "MIT" ]
null
null
null
import cv2 import numpy as np video_path = 'C:\\Data\\beeWatch\\temp\\Erlen_Hive_11_20190916_125421_540_M.mp4' cap = cv2.VideoCapture(video_path) subtractor = cv2.createBackgroundSubtractorMOG2(history=5, varThreshold = 25, detectShadows = False) #120 frames moving window, reduction, filtering, morfological tra...
26.909091
190
0.699324
import cv2 import numpy as np video_path = 'C:\\Data\\beeWatch\\temp\\Erlen_Hive_11_20190916_125421_540_M.mp4' cap = cv2.VideoCapture(video_path) subtractor = cv2.createBackgroundSubtractorMOG2(history=5, varThreshold = 25, detectShadows = False) while True: _, frame = cap.read() mask = subtracto...
true
true
1c3c4677450a24582376f55b330463c7b4000eaf
2,971
py
Python
tests/test_loader.py
pyarmory/pike
02faeec21a9a9cad5d928ab8830776612f81e084
[ "Apache-2.0" ]
21
2015-07-05T20:02:10.000Z
2022-02-02T07:04:22.000Z
tests/test_loader.py
pyarmory/pike
02faeec21a9a9cad5d928ab8830776612f81e084
[ "Apache-2.0" ]
9
2015-07-23T16:30:50.000Z
2018-10-06T15:11:32.000Z
tests/test_loader.py
pyarmory/pike
02faeec21a9a9cad5d928ab8830776612f81e084
[ "Apache-2.0" ]
5
2016-05-26T15:27:35.000Z
2018-03-26T16:01:02.000Z
import os import py_compile import six import pytest from pike.finder import PikeFinder from pike.loader import PikeLoader from tests import utils SIMPLE_CLASS = """ class Tracer(object): pass """ @pytest.fixture def loader_finder(): temp_folder = utils.make_tmpdir() # Create a simple package pkg_...
24.758333
76
0.736789
import os import py_compile import six import pytest from pike.finder import PikeFinder from pike.loader import PikeLoader from tests import utils SIMPLE_CLASS = """ class Tracer(object): pass """ @pytest.fixture def loader_finder(): temp_folder = utils.make_tmpdir() pkg_location = utils.create_w...
true
true
1c3c46902f4580ab653d3e9fcc2985d872cebf22
323
py
Python
.history/catalog/urls_20220303122221.py
arsalandehghani/locallibrary
786bbfa33dc06d9b217c4139bb6bc3886c714e8b
[ "MIT" ]
null
null
null
.history/catalog/urls_20220303122221.py
arsalandehghani/locallibrary
786bbfa33dc06d9b217c4139bb6bc3886c714e8b
[ "MIT" ]
null
null
null
.history/catalog/urls_20220303122221.py
arsalandehghani/locallibrary
786bbfa33dc06d9b217c4139bb6bc3886c714e8b
[ "MIT" ]
null
null
null
from unicodedata import name from django.contrib import admin from django.urls import include, path, url from . import views urlpatterns = [ # path('admin/', admin.site.urls), # path('catalog/', include('catalog.urls')), # path('catalog/', include('catalog.urls')), url(r'^$', views.index, name='index')...
26.916667
48
0.668731
from unicodedata import name from django.contrib import admin from django.urls import include, path, url from . import views urlpatterns = [ url(r'^$', views.index, name='index') ]
true
true
1c3c46de5aaf717c2f8e02915a38226fe5c05d78
3,655
py
Python
.history/DEBER_20210831114515.py
Alopezm5/PROYECTO-PARTE-1
bd7a8594edf08d41c6ca544cf6bac01ea4fcb684
[ "MIT" ]
null
null
null
.history/DEBER_20210831114515.py
Alopezm5/PROYECTO-PARTE-1
bd7a8594edf08d41c6ca544cf6bac01ea4fcb684
[ "MIT" ]
null
null
null
.history/DEBER_20210831114515.py
Alopezm5/PROYECTO-PARTE-1
bd7a8594edf08d41c6ca544cf6bac01ea4fcb684
[ "MIT" ]
null
null
null
class Nomina: def __init__(self,nom="",ruc=0,dire="",tele=0,ciud="",tipEmpr="",email="",estado="",profe="",dep=""):#3 self.nombre=nom self.ruc=ruc self.direccion=dire self.telefono=tele self.ciudad=ciud self.tipoEmpresa=tipEmpr self.correo=email self....
37.295918
247
0.655814
class Nomina: def __init__(self,nom="",ruc=0,dire="",tele=0,ciud="",tipEmpr="",email="",estado="",profe="",dep=""): self.nombre=nom self.ruc=ruc self.direccion=dire self.telefono=tele self.ciudad=ciud self.tipoEmpresa=tipEmpr self.correo=email self.es...
false
true
1c3c471e66ff3c07b3c278fb5b67e271f8807ac8
5,093
py
Python
ga.py
G0D0T/GAforPartitioning
cbc2900722e94049ead3e6f7c8d61c66b6434f49
[ "Apache-2.0" ]
null
null
null
ga.py
G0D0T/GAforPartitioning
cbc2900722e94049ead3e6f7c8d61c66b6434f49
[ "Apache-2.0" ]
null
null
null
ga.py
G0D0T/GAforPartitioning
cbc2900722e94049ead3e6f7c8d61c66b6434f49
[ "Apache-2.0" ]
null
null
null
import random # Funzione che calcola il "costo" della partizione, dato il cromosoma e la lista dei valori def partition(x, y): a = b = 0 for i in range(len(x)): # Se nel cromosoma ho 0 all'i-esimo bit, metto nella partizione a l'i-esimo elemento if not x[i]: a += y[i] # Vic...
35.124138
132
0.595131
import random def partition(x, y): a = b = 0 for i in range(len(x)): if not x[i]: a += y[i] else: b += y[i] # Ritorno il valore assoluto (più è vicino a 0 e migliore è la partizione) return abs(a - b) def gen_population(s, n): population...
true
true
1c3c472bd30540645228b38acb96974af7c41f45
142
py
Python
lan for loop.py
keerthana1502/python_practice
8c0499e014826af78f9a88730551ace3fa79686d
[ "bzip2-1.0.6" ]
null
null
null
lan for loop.py
keerthana1502/python_practice
8c0499e014826af78f9a88730551ace3fa79686d
[ "bzip2-1.0.6" ]
null
null
null
lan for loop.py
keerthana1502/python_practice
8c0499e014826af78f9a88730551ace3fa79686d
[ "bzip2-1.0.6" ]
null
null
null
def func(x): y=4 return lambda z: x+y+z for i in range(5): closure=func(i) print("closure ",i+5," = ","closure ",closure(i+5))
23.666667
55
0.56338
def func(x): y=4 return lambda z: x+y+z for i in range(5): closure=func(i) print("closure ",i+5," = ","closure ",closure(i+5))
true
true
1c3c48637e933d14a61af82aacba2c2a82af796c
1,686
py
Python
homeassistant/components/shelly/switch.py
inishchith/core
90892d275c259088ed302bdaa8838303a6ef4094
[ "Apache-2.0" ]
1
2020-03-10T21:16:17.000Z
2020-03-10T21:16:17.000Z
homeassistant/components/shelly/switch.py
inishchith/core
90892d275c259088ed302bdaa8838303a6ef4094
[ "Apache-2.0" ]
38
2020-10-15T06:46:44.000Z
2022-03-31T06:02:48.000Z
homeassistant/components/shelly/switch.py
michaellunzer/core
1b0c421300812c026dcc077731250cd91e6c618a
[ "Apache-2.0" ]
null
null
null
"""Switch for Shelly.""" from aioshelly import RelayBlock from homeassistant.components.switch import SwitchEntity from homeassistant.core import callback from . import ShellyDeviceWrapper from .const import DOMAIN from .entity import ShellyBlockEntity async def async_setup_entry(hass, config_entry, async_add_entit...
30.654545
86
0.688612
from aioshelly import RelayBlock from homeassistant.components.switch import SwitchEntity from homeassistant.core import callback from . import ShellyDeviceWrapper from .const import DOMAIN from .entity import ShellyBlockEntity async def async_setup_entry(hass, config_entry, async_add_entities): wrapper = hass....
true
true
1c3c4a2cce80f170a0f8ed6fe9213991a3b0314f
1,366
py
Python
configs/_base_/models/emanet_r50-d8.py
Xlinford/mmsegmentation
8b444de5e6db2af2538a73a93ac75204f5c3bb2f
[ "Apache-2.0" ]
null
null
null
configs/_base_/models/emanet_r50-d8.py
Xlinford/mmsegmentation
8b444de5e6db2af2538a73a93ac75204f5c3bb2f
[ "Apache-2.0" ]
null
null
null
configs/_base_/models/emanet_r50-d8.py
Xlinford/mmsegmentation
8b444de5e6db2af2538a73a93ac75204f5c3bb2f
[ "Apache-2.0" ]
null
null
null
# model settings norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( type='EncoderDecoder', pretrained='open-mmlab://resnet50_v1c', backbone=dict( type='ResNetV1c', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), dilations=(1, 1, 2, 4), ...
28.458333
75
0.564422
norm_cfg = dict(type='SyncBN', requires_grad=True) model = dict( type='EncoderDecoder', pretrained='open-mmlab://resnet50_v1c', backbone=dict( type='ResNetV1c', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), dilations=(1, 1, 2, 4), strides=(1, 2,...
true
true
1c3c4a74eaae277807fe507f81a945f2f9b01f2f
313
py
Python
vnpy/api/websocket/__init__.py
bixia/MyVnpy
c0b464dce2ca65b0d040472b53a581d933c8b742
[ "MIT" ]
null
null
null
vnpy/api/websocket/__init__.py
bixia/MyVnpy
c0b464dce2ca65b0d040472b53a581d933c8b742
[ "MIT" ]
null
null
null
vnpy/api/websocket/__init__.py
bixia/MyVnpy
c0b464dce2ca65b0d040472b53a581d933c8b742
[ "MIT" ]
null
null
null
# -*- encoding: utf-8 -*- ''' @File : __init__.py @License : (C)Copyright 2017-2018, Liugroup-NLPR-CASIA @Modify Time @Author @Version @Desciption ------------ ------- -------- ----------- 2021/4/3 10:10 Li Qiwen 1.0 None ''' from .websocket import WebsocketClient
31.3
56
0.504792
from .websocket import WebsocketClient
true
true
1c3c4b065d4f5d21bbce25de69e1bad508491d6d
17,615
py
Python
isi_sdk_8_1_0/isi_sdk_8_1_0/models/upgrade_cluster.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
24
2018-06-22T14:13:23.000Z
2022-03-23T01:21:26.000Z
isi_sdk_8_1_0/isi_sdk_8_1_0/models/upgrade_cluster.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
46
2018-04-30T13:28:22.000Z
2022-03-21T21:11:07.000Z
isi_sdk_8_1_0/isi_sdk_8_1_0/models/upgrade_cluster.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
29
2018-06-19T00:14:04.000Z
2022-02-08T17:51:19.000Z
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 5 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ import pprint import re # noqa: F401 import six from isi_sdk_8_1_0.models.cluster...
36.469979
356
0.663582
import pprint import re import six from isi_sdk_8_1_0.models.cluster_nodes_onefs_version import ClusterNodesOnefsVersion from isi_sdk_8_1_0.models.upgrade_cluster_cluster_overview import UpgradeClusterClusterOverview from isi_sdk_8_1_0.models.upgrade_cluster_upgrade_settings import UpgradeClusterUpgradeSett...
true
true
1c3c4b0bd7753094384ce55ea4377074e4dd8d8f
1,667
py
Python
tools/tinyos/python/__init__.py
thp-comnets/tinyos-main
a8363f9acc0cd7361de31c1531858d2bfb2a75df
[ "BSD-3-Clause" ]
1
2017-11-09T06:07:24.000Z
2017-11-09T06:07:24.000Z
tinyos3/__init__.py
gollum18/tinyos3
925e2997b001a8816f601a214b6b1fc86c2c5b03
[ "CNRI-Python" ]
null
null
null
tinyos3/__init__.py
gollum18/tinyos3
925e2997b001a8816f601a214b6b1fc86c2c5b03
[ "CNRI-Python" ]
1
2015-01-26T17:39:57.000Z
2015-01-26T17:39:57.000Z
# # Copyright (c) 2005 # The President and Fellows of Harvard College. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of...
50.515152
77
0.770846
__all__ = ["message", "packet", "utils", "tossim", "misc"]
true
true
1c3c4b96adafe33c942e391854eb089741427164
1,196
py
Python
platypush/backend/pushbullet/listener.py
BlackLight/platypush
6c0a8bf2599eb4ab41a6122dbd988075d8b1a63a
[ "MIT" ]
228
2018-01-30T11:17:09.000Z
2022-03-24T11:22:26.000Z
platypush/backend/pushbullet/listener.py
BlackLight/platypush
6c0a8bf2599eb4ab41a6122dbd988075d8b1a63a
[ "MIT" ]
167
2017-12-11T19:35:38.000Z
2022-03-27T14:45:30.000Z
platypush/backend/pushbullet/listener.py
BlackLight/runbullet
8d26c8634d2677b4402f0a21b9ab8244b44640db
[ "MIT" ]
16
2018-05-03T07:31:56.000Z
2021-12-05T19:27:37.000Z
import logging import time from typing import Callable, Optional from pushbullet import Listener as _Listener class Listener(_Listener): """ Extends the Pushbullet Listener object by adding ``on_open`` and ``on_close`` handlers. """ def __init__(self, *args, on_open:...
27.181818
91
0.562709
import logging import time from typing import Callable, Optional from pushbullet import Listener as _Listener class Listener(_Listener): def __init__(self, *args, on_open: Optional[Callable[[], None]] = None, on_close: Optional[Callable[[], None]] = None, ...
true
true
1c3c4bdd31b8713dcd3ebb3084cb9d78ed721b3d
214,380
py
Python
OldVersions/Viav021.py
GreenGilad/VIA
01b408f3abaf3b42ea13cccd49748cafdca56f07
[ "MIT" ]
24
2021-02-12T12:31:43.000Z
2022-03-27T12:52:05.000Z
OldVersions/Viav021.py
GreenGilad/VIA
01b408f3abaf3b42ea13cccd49748cafdca56f07
[ "MIT" ]
13
2021-09-22T21:59:00.000Z
2022-01-24T12:40:01.000Z
OldVersions/Viav021.py
GreenGilad/VIA
01b408f3abaf3b42ea13cccd49748cafdca56f07
[ "MIT" ]
11
2021-08-04T05:33:18.000Z
2022-03-10T22:57:44.000Z
import numpy as np import pandas as pd from scipy.sparse import csr_matrix, csgraph import scipy import igraph as ig import leidenalg import time import hnswlib import matplotlib.pyplot as plt import matplotlib import math import multiprocessing from scipy.sparse.csgraph import minimum_spanning_tree from scipy import s...
50.970043
310
0.602374
import numpy as np import pandas as pd from scipy.sparse import csr_matrix, csgraph import scipy import igraph as ig import leidenalg import time import hnswlib import matplotlib.pyplot as plt import matplotlib import math import multiprocessing from scipy.sparse.csgraph import minimum_spanning_tree from scipy import s...
true
true
1c3c4d5c4687d6171dcb57b98a7e1ca4b53999c6
9,971
py
Python
stanfordcorenlp/corenlp.py
icmpnorequest/stanford-corenlp
5cefdb271f6f6b63648f869e6d39aa4ff5ae944e
[ "MIT" ]
882
2017-05-28T16:55:25.000Z
2022-03-27T17:10:17.000Z
stanfordcorenlp/corenlp.py
icmpnorequest/stanford-corenlp
5cefdb271f6f6b63648f869e6d39aa4ff5ae944e
[ "MIT" ]
84
2017-05-28T18:38:34.000Z
2022-03-10T05:17:38.000Z
stanfordcorenlp/corenlp.py
icmpnorequest/stanford-corenlp
5cefdb271f6f6b63648f869e6d39aa4ff5ae944e
[ "MIT" ]
224
2017-06-11T13:49:29.000Z
2022-02-23T16:17:06.000Z
# _*_coding:utf-8_*_ from __future__ import print_function import glob import json import logging import os import re import socket import subprocess import sys import time import psutil try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse import requests class Stanford...
38.949219
120
0.568549
from __future__ import print_function import glob import json import logging import os import re import socket import subprocess import sys import time import psutil try: from urlparse import urlparse except ImportError: from urllib.parse import urlparse import requests class StanfordCoreNLP: def __i...
true
true
1c3c4d5f7591d15c9226f6e4d4579353121a6ee3
70,836
py
Python
vu_lib/ipy_lib3.py
markmelnic/VU-Lib
78f403d54bce1d4b82912a6daffebf15a96f64c6
[ "MIT" ]
null
null
null
vu_lib/ipy_lib3.py
markmelnic/VU-Lib
78f403d54bce1d4b82912a6daffebf15a96f64c6
[ "MIT" ]
null
null
null
vu_lib/ipy_lib3.py
markmelnic/VU-Lib
78f403d54bce1d4b82912a6daffebf15a96f64c6
[ "MIT" ]
null
null
null
''' Created on 30 Jan. 2012 Finished on 6 Feb. 2012 Improvements: - 31 Mar. 2020 to 31 Mar. 2020: fixed compatibility issues of Matplotlib and Tinker on OS X machines. - 19 Nov. 2019 to 22 Nov. 2019: rewrote Programming for Economists ipy_lib to Python 3.7 and merged with this one. - 15 Nov. 2019 to 18 Nov...
35.032641
160
0.59162
import tkinter as _tk import tkinter.dialog as _Dialog import tkinter.filedialog as _tkFileDialog import tkinter.messagebox as _tkMessageBox import queue as _Queue import threading as _threading import time as _time import os as _os import random as _random import sys as _sys import datetime as _datetime import pickle ...
true
true
1c3c4e3803b9202adb0b6574ba964cbaae36a77b
316
py
Python
env/lib/python3.5/site-packages/pylint/test/functional/wrong_exception_operation.py
Udolf15/recommedMeMovies
be5ae74acd98e3f93beaaa5bb55623974fb24247
[ "MIT" ]
463
2015-01-15T08:17:42.000Z
2022-03-28T15:10:20.000Z
env/lib/python3.5/site-packages/pylint/test/functional/wrong_exception_operation.py
Udolf15/recommedMeMovies
be5ae74acd98e3f93beaaa5bb55623974fb24247
[ "MIT" ]
52
2015-01-06T02:43:59.000Z
2022-03-14T11:15:21.000Z
env/lib/python3.5/site-packages/pylint/test/functional/wrong_exception_operation.py
Udolf15/recommedMeMovies
be5ae74acd98e3f93beaaa5bb55623974fb24247
[ "MIT" ]
249
2015-01-07T22:49:49.000Z
2022-03-18T02:32:06.000Z
# pylint: disable=missing-docstring, superfluous-parens try: 1/0 except (ValueError | TypeError): # [wrong-exception-operation] pass try: 1/0 except (ValueError + TypeError): # [wrong-exception-operation] pass try: 1/0 except (ValueError < TypeError): # [wrong-exception-operation] pass
16.631579
62
0.686709
try: 1/0 except (ValueError | TypeError): pass try: 1/0 except (ValueError + TypeError): pass try: 1/0 except (ValueError < TypeError): pass
true
true
1c3c4f3ecb0e4c73eb385a69fc9f5d9d15933f65
2,679
py
Python
src/training_utils.py
ArminKaramzade/SequenceMixup
52eb053bd21f81db0aba0932da83dc06aaaee46f
[ "MIT" ]
null
null
null
src/training_utils.py
ArminKaramzade/SequenceMixup
52eb053bd21f81db0aba0932da83dc06aaaee46f
[ "MIT" ]
null
null
null
src/training_utils.py
ArminKaramzade/SequenceMixup
52eb053bd21f81db0aba0932da83dc06aaaee46f
[ "MIT" ]
null
null
null
import numpy as np def pad_sequence(sequences, batch_first=True, padding_value=0, padding='post'): max_size = sequences[0].size() trailing_dims = max_size[1:] max_len = max([s.size(0) for s in sequences]) if batch_first: out_dims = (len(sequences), max_len) + trailing_dims else: out...
36.69863
85
0.524823
import numpy as np def pad_sequence(sequences, batch_first=True, padding_value=0, padding='post'): max_size = sequences[0].size() trailing_dims = max_size[1:] max_len = max([s.size(0) for s in sequences]) if batch_first: out_dims = (len(sequences), max_len) + trailing_dims else: out...
true
true
1c3c4f7d326d3e61a2360b50c58382ee9fd91e55
2,179
py
Python
tests/models/v2/save_config_spec_test.py
NetApp/santricity-webapi-pythonsdk
1d3df4a00561192f4cdcdd1890f4d27547ed2de2
[ "BSD-3-Clause-Clear" ]
5
2016-08-23T17:52:22.000Z
2019-05-16T08:45:30.000Z
tests/models/v2/save_config_spec_test.py
NetApp/santricity-webapi-pythonsdk
1d3df4a00561192f4cdcdd1890f4d27547ed2de2
[ "BSD-3-Clause-Clear" ]
2
2016-11-10T05:30:21.000Z
2019-04-05T15:03:37.000Z
tests/models/v2/save_config_spec_test.py
NetApp/santricity-webapi-pythonsdk
1d3df4a00561192f4cdcdd1890f4d27547ed2de2
[ "BSD-3-Clause-Clear" ]
7
2016-08-25T16:11:44.000Z
2021-02-22T05:31:25.000Z
#!/usr/bin/env python # coding: utf-8 """ The Clear BSD License Copyright (c) – 2016, NetApp, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions...
57.342105
845
0.773291
import unittest from netapp.santricity.models.v2.save_config_spec import SaveConfigSpec class SaveConfigSpecTest(unittest.TestCase): def test_save_config_spec(self): save_config_spec_obj = SaveConfigSpec() self.assertNotEqual(save_config_spec_obj, None)
true
true
1c3c4fd2537cd0c79606063e10cad90a4c941a2f
847
py
Python
doc/extensions/yt_showfields.py
kastalpes/yt
b1e197ca84433fbd61eaf44b28ff5cdb37981d4c
[ "BSD-3-Clause-Clear" ]
2
2021-03-02T18:59:49.000Z
2021-03-02T18:59:50.000Z
doc/extensions/yt_showfields.py
kastalpes/yt
b1e197ca84433fbd61eaf44b28ff5cdb37981d4c
[ "BSD-3-Clause-Clear" ]
4
2018-04-13T23:03:42.000Z
2018-05-08T17:50:43.000Z
doc/extensions/yt_showfields.py
kastalpes/yt
b1e197ca84433fbd61eaf44b28ff5cdb37981d4c
[ "BSD-3-Clause-Clear" ]
2
2020-05-16T15:29:37.000Z
2020-06-22T10:17:08.000Z
import subprocess import sys from docutils.parsers.rst import Directive def setup(app): app.add_directive('yt_showfields', ShowFields) setup.app = app setup.config = app.config setup.confdir = app.confdir retdict = dict( version='1.0', parallel_read_safe=True, parallel_...
25.666667
67
0.661157
import subprocess import sys from docutils.parsers.rst import Directive def setup(app): app.add_directive('yt_showfields', ShowFields) setup.app = app setup.config = app.config setup.confdir = app.confdir retdict = dict( version='1.0', parallel_read_safe=True, parallel_...
true
true
1c3c4ffd84971e02c8f9355aeda7355ea56191d6
1,723
py
Python
src/Parser.py
blankettripod/Pastrel
2e637a8f2801d784e449369218111924a3927a3a
[ "Apache-2.0" ]
null
null
null
src/Parser.py
blankettripod/Pastrel
2e637a8f2801d784e449369218111924a3927a3a
[ "Apache-2.0" ]
null
null
null
src/Parser.py
blankettripod/Pastrel
2e637a8f2801d784e449369218111924a3927a3a
[ "Apache-2.0" ]
null
null
null
import Utility from Token import * from Error import Error from Node import Node from rule import * from ruleset import * class Parser: def __init__(self, tokens: list[Token], rules: list[Rule]): self.tokens = tokens self.rules = rules def parse(self) -> list[Node]: # slr(2) parser ...
24.971014
84
0.557168
import Utility from Token import * from Error import Error from Node import Node from rule import * from ruleset import * class Parser: def __init__(self, tokens: list[Token], rules: list[Rule]): self.tokens = tokens self.rules = rules def parse(self) -> list[Node]: stack: l...
true
true
1c3c51aab760ef6aa1d004dafc169d97a2ad0c8f
23,067
py
Python
fuzzinator/controller.py
pmatos/fuzzinator
c4af854110cdf2e70fd174b8bf2f6b737b53193a
[ "BSD-3-Clause" ]
null
null
null
fuzzinator/controller.py
pmatos/fuzzinator
c4af854110cdf2e70fd174b8bf2f6b737b53193a
[ "BSD-3-Clause" ]
null
null
null
fuzzinator/controller.py
pmatos/fuzzinator
c4af854110cdf2e70fd174b8bf2f6b737b53193a
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2016-2021 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import os import shutil import time import traceback from math im...
45.497041
178
0.592621
import os import shutil import time import traceback from math import inf from multiprocessing import Lock, Process, Queue import psutil from inators.imp import import_object from .config import as_bool, as_int_or_inf, as_path, config_get_callable, config_get_fuzzers, config_get_kwargs from .job import FuzzJ...
true
true
1c3c522b701a45cbf827f98dfc6a46b019906c0d
27,084
py
Python
dace/codegen/targets/framecode.py
xiacijie/dace
2d942440b1d7b139ba112434bfa78f754e10bfe5
[ "BSD-3-Clause" ]
1
2021-07-26T07:58:06.000Z
2021-07-26T07:58:06.000Z
dace/codegen/targets/framecode.py
xiacijie/dace
2d942440b1d7b139ba112434bfa78f754e10bfe5
[ "BSD-3-Clause" ]
null
null
null
dace/codegen/targets/framecode.py
xiacijie/dace
2d942440b1d7b139ba112434bfa78f754e10bfe5
[ "BSD-3-Clause" ]
null
null
null
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved. from typing import Optional, Set, Tuple import collections import copy import dace import functools import re from dace.codegen import control_flow as cflow from dace.codegen import dispatcher as disp from dace.codegen.prettycode import CodeIO...
42.384977
88
0.553796
from typing import Optional, Set, Tuple import collections import copy import dace import functools import re from dace.codegen import control_flow as cflow from dace.codegen import dispatcher as disp from dace.codegen.prettycode import CodeIOStream from dace.codegen.targets.common import codeblock_to_cpp, sym2cpp fr...
true
true
1c3c5264750eed447ffd84dd0522f448f45fe831
69
py
Python
double3/double3sdk/tilt/tilt.py
CLOMING/winter2021_double
9b920baaeb3736a785a6505310b972c49b5b21e9
[ "Apache-2.0" ]
null
null
null
double3/double3sdk/tilt/tilt.py
CLOMING/winter2021_double
9b920baaeb3736a785a6505310b972c49b5b21e9
[ "Apache-2.0" ]
null
null
null
double3/double3sdk/tilt/tilt.py
CLOMING/winter2021_double
9b920baaeb3736a785a6505310b972c49b5b21e9
[ "Apache-2.0" ]
null
null
null
from double3sdk.double_api import _DoubleAPI class _Tilt: pass
11.5
44
0.782609
from double3sdk.double_api import _DoubleAPI class _Tilt: pass
true
true
1c3c53632c876445c634eb0c6daafc59ef50abc0
17,388
py
Python
tests/test_filtering.py
nextfit/tortoise-orm
06bcecaf769d12c21c0da950950f030c8e74659a
[ "Apache-2.0" ]
null
null
null
tests/test_filtering.py
nextfit/tortoise-orm
06bcecaf769d12c21c0da950950f030c8e74659a
[ "Apache-2.0" ]
null
null
null
tests/test_filtering.py
nextfit/tortoise-orm
06bcecaf769d12c21c0da950950f030c8e74659a
[ "Apache-2.0" ]
null
null
null
from pypika.functions import Coalesce, Count, Length, Lower, Trim, Upper from tests.testmodels import Event, IntFields, Reporter, Team, Tournament from tortoise.contrib import test from tortoise.exceptions import FieldError from tortoise.filters.q import Q from tortoise.query.expressions import F class TestFiltering...
45.518325
100
0.679549
from pypika.functions import Coalesce, Count, Length, Lower, Trim, Upper from tests.testmodels import Event, IntFields, Reporter, Team, Tournament from tortoise.contrib import test from tortoise.exceptions import FieldError from tortoise.filters.q import Q from tortoise.query.expressions import F class TestFiltering...
true
true
1c3c53cbb02869747faafe0d29281a71dde13196
895
py
Python
isi_sdk_9_0_0/test/test_progress_global.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
24
2018-06-22T14:13:23.000Z
2022-03-23T01:21:26.000Z
isi_sdk_9_0_0/test/test_progress_global.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
46
2018-04-30T13:28:22.000Z
2022-03-21T21:11:07.000Z
isi_sdk_9_0_0/test/test_progress_global.py
mohitjain97/isilon_sdk_python
a371f438f542568edb8cda35e929e6b300b1177c
[ "Unlicense" ]
29
2018-06-19T00:14:04.000Z
2022-02-08T17:51:19.000Z
# coding: utf-8 """ Isilon SDK Isilon SDK - Language bindings for the OneFS API # noqa: E501 OpenAPI spec version: 10 Contact: sdk@isilon.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from __future__ import absolute_import import unittest import isi_sdk_9_0_0 from ...
21.829268
85
0.702793
from __future__ import absolute_import import unittest import isi_sdk_9_0_0 from isi_sdk_9_0_0.models.progress_global import ProgressGlobal from isi_sdk_9_0_0.rest import ApiException class TestProgressGlobal(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def...
true
true
1c3c546677148ccdcdf143e4d5d7a475beb9fc59
2,394
py
Python
dbscan/dbscan_ex_1.py
RoteKekse/FDAsandbox
4668ea3b7adf4908175719caf1fded808f012b85
[ "MIT" ]
null
null
null
dbscan/dbscan_ex_1.py
RoteKekse/FDAsandbox
4668ea3b7adf4908175719caf1fded808f012b85
[ "MIT" ]
null
null
null
dbscan/dbscan_ex_1.py
RoteKekse/FDAsandbox
4668ea3b7adf4908175719caf1fded808f012b85
[ "MIT" ]
null
null
null
print(__doc__) import numpy as np from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn.datasets.samples_generator import make_blobs from sklearn.preprocessing import StandardScaler # ############################################################################# # Generate sample data centers =...
35.205882
79
0.630326
print(__doc__) import numpy as np from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn.datasets.samples_generator import make_blobs from sklearn.preprocessing import StandardScaler
true
true
1c3c55ba1a8d1bee5b7db815486c668aa42d61ff
7,043
py
Python
util/my_decode_packet_trace.py
nanocad-lab/sdecc-gem5-stable-50ff05095970
9ba035fa33eabe5b4866a51479dbcc7f99c5c974
[ "BSD-3-Clause" ]
null
null
null
util/my_decode_packet_trace.py
nanocad-lab/sdecc-gem5-stable-50ff05095970
9ba035fa33eabe5b4866a51479dbcc7f99c5c974
[ "BSD-3-Clause" ]
null
null
null
util/my_decode_packet_trace.py
nanocad-lab/sdecc-gem5-stable-50ff05095970
9ba035fa33eabe5b4866a51479dbcc7f99c5c974
[ "BSD-3-Clause" ]
1
2018-01-11T05:59:45.000Z
2018-01-11T05:59:45.000Z
#!/usr/bin/env python # Copyright (c) 2013-2014 ARM Limited # All rights reserved # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implement...
40.017045
128
0.637938
import protolib import sys try: import packet_pb2 except: print "Did not find packet proto definitions, attempting to generate" from subprocess import call error = call(['protoc', '--python_out=util', '--proto_path=src/proto', 'src/...
false
true
1c3c55c6da3aec9ad7024f900efa4d0038a651ad
2,799
py
Python
code.py
shambhavit14/Olympic-hero
58aa58a46daeaf4486fcdf9fc4aa9e026f683f92
[ "MIT" ]
null
null
null
code.py
shambhavit14/Olympic-hero
58aa58a46daeaf4486fcdf9fc4aa9e026f683f92
[ "MIT" ]
null
null
null
code.py
shambhavit14/Olympic-hero
58aa58a46daeaf4486fcdf9fc4aa9e026f683f92
[ "MIT" ]
null
null
null
# -------------- #Importing header files import pandas as pd import numpy as np import matplotlib.pyplot as plt #Path of the file data = pd.read_csv(path) data.rename(columns = {'Total':'Total_Medals'},inplace = True) data.head(10) #Code starts here # -------------- #Code starts here data['Better_Eve...
29.776596
165
0.6806
import pandas as pd import numpy as np import matplotlib.pyplot as plt data = pd.read_csv(path) data.rename(columns = {'Total':'Total_Medals'},inplace = True) data.head(10) data['Better_Event'] = np.where(data['Total_Summer'] == data['Total_Winter'] , 'Both' , (np.where(data['Total_Summer'] > data[...
true
true
1c3c560a73b1a038c13899cb31cf26c009c09c4e
425
py
Python
Portfolio_Django/Portfolio_Django/asgi.py
adityagirigoudar/adityagirigoudar.github.io
3e8631a528d5ad01d80bb0d563267385c196af31
[ "Apache-2.0" ]
null
null
null
Portfolio_Django/Portfolio_Django/asgi.py
adityagirigoudar/adityagirigoudar.github.io
3e8631a528d5ad01d80bb0d563267385c196af31
[ "Apache-2.0" ]
null
null
null
Portfolio_Django/Portfolio_Django/asgi.py
adityagirigoudar/adityagirigoudar.github.io
3e8631a528d5ad01d80bb0d563267385c196af31
[ "Apache-2.0" ]
null
null
null
""" ASGI config for Portfolio_Django project. It exposes the ASGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/ """ import os from django.core.asgi import get_asgi_application os.environ.se...
25
79
0.764706
import os from django.core.asgi import get_asgi_application os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Portfolio_Django.settings') application = get_asgi_application()
true
true
1c3c56332fed0fe4a3ce8df20169d07642f8eaa9
2,695
py
Python
betellib.py
hippke/betelbot
8cd9292f272d504627c1def7bf99ace8d1a6a4cc
[ "MIT" ]
48
2020-01-29T16:10:06.000Z
2022-03-26T21:55:19.000Z
betellib.py
hippke/betelbot
8cd9292f272d504627c1def7bf99ace8d1a6a4cc
[ "MIT" ]
3
2020-01-29T21:28:06.000Z
2020-06-11T09:11:07.000Z
betellib.py
hippke/betelbot
8cd9292f272d504627c1def7bf99ace8d1a6a4cc
[ "MIT" ]
5
2020-02-10T05:35:44.000Z
2021-01-26T18:05:21.000Z
import os import requests import numpy as np from twython import Twython from bs4 import BeautifulSoup from astropy.stats import biweight_location consumer_key = os.environ.get('consumer_key') consumer_secret = os.environ.get('consumer_secret') access_token = os.environ.get('access_token') access_token_secret = os.en...
30.977011
87
0.605566
import os import requests import numpy as np from twython import Twython from bs4 import BeautifulSoup from astropy.stats import biweight_location consumer_key = os.environ.get('consumer_key') consumer_secret = os.environ.get('consumer_secret') access_token = os.environ.get('access_token') access_token_secret = os.en...
true
true
1c3c567cb1666d4b50d5ad26b75b422c2ec15f81
1,449
py
Python
mirumon/services/wmi_api/hardware.py
mirumon/mirumon-windows-client
8d21726288478174467a436fe94e1c1831bda9e7
[ "MIT" ]
1
2021-09-15T09:17:32.000Z
2021-09-15T09:17:32.000Z
mirumon/services/wmi_api/hardware.py
mirumon/mirumon-windows-client
8d21726288478174467a436fe94e1c1831bda9e7
[ "MIT" ]
6
2019-09-14T18:15:19.000Z
2019-12-03T22:27:45.000Z
mirumon/services/wmi_api/hardware.py
mirumon/mirumon-win-client
8d21726288478174467a436fe94e1c1831bda9e7
[ "MIT" ]
null
null
null
from typing import Any, List import wmi from mirumon.schemas.computer.hardware import ( HardwareModel, MotherBoardModel, NetworkAdapterModel, PhysicalDiskModel, ProcessorModel, VideoControllerModel, ) def get_motherboard(computer: wmi.WMI, *_: Any) -> MotherBoardModel: mother = computer....
27.865385
86
0.717736
from typing import Any, List import wmi from mirumon.schemas.computer.hardware import ( HardwareModel, MotherBoardModel, NetworkAdapterModel, PhysicalDiskModel, ProcessorModel, VideoControllerModel, ) def get_motherboard(computer: wmi.WMI, *_: Any) -> MotherBoardModel: mother = computer....
true
true
1c3c579051c05fdef3ca697113d59e6cca957f96
609
py
Python
Resene naloge/euler32.py
CadezDavid/ProjectEuler
9e11aa5782fb600c98eba9e04766b3bd79acea0e
[ "MIT" ]
null
null
null
Resene naloge/euler32.py
CadezDavid/ProjectEuler
9e11aa5782fb600c98eba9e04766b3bd79acea0e
[ "MIT" ]
null
null
null
Resene naloge/euler32.py
CadezDavid/ProjectEuler
9e11aa5782fb600c98eba9e04766b3bd79acea0e
[ "MIT" ]
null
null
null
from itertools import permutations def je_pandigital(stevilo): return len(str(stevilo)) == 9 and len(set(str(stevilo))) == 9 and isinstance(stevilo, int) def tuple_to_str(tuple): string = '' for indeks in range(len(tuple)): string += str(tuple[indeks]) return string seznam_pandigital_st = set...
32.052632
94
0.660099
from itertools import permutations def je_pandigital(stevilo): return len(str(stevilo)) == 9 and len(set(str(stevilo))) == 9 and isinstance(stevilo, int) def tuple_to_str(tuple): string = '' for indeks in range(len(tuple)): string += str(tuple[indeks]) return string seznam_pandigital_st = set...
true
true
1c3c58028e0d35172b0466f5d0bbf2eaa391023d
15,535
py
Python
docker_ws/src/keras-YOLOv3-model-set/yolo4/models/layers.py
Pomiculture/GAN-Vitis-AI
148da346c3ec882f24a98b8231800a94c54cc709
[ "Apache-2.0" ]
2
2021-08-10T13:38:19.000Z
2021-09-27T03:06:40.000Z
docker_ws/src/keras-YOLOv3-model-set/yolo4/models/layers.py
Pomiculture/GAN-Vitis-AI
148da346c3ec882f24a98b8231800a94c54cc709
[ "Apache-2.0" ]
null
null
null
docker_ws/src/keras-YOLOv3-model-set/yolo4/models/layers.py
Pomiculture/GAN-Vitis-AI
148da346c3ec882f24a98b8231800a94c54cc709
[ "Apache-2.0" ]
2
2021-12-30T09:04:13.000Z
2021-12-30T09:04:14.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Common layer definition for YOLOv4 models building """ from functools import wraps, reduce import tensorflow.keras.backend as K from tensorflow.keras.layers import Conv2D, DepthwiseConv2D, Concatenate, MaxPooling2D, BatchNormalization, Activation, UpSampling2D, ZeroPa...
42.561644
147
0.683618
from functools import wraps, reduce import tensorflow.keras.backend as K from tensorflow.keras.layers import Conv2D, DepthwiseConv2D, Concatenate, MaxPooling2D, BatchNormalization, Activation, UpSampling2D, ZeroPadding2D from tensorflow.keras.layers import LeakyReLU from tensorflow.keras.regularizers import l2 from...
true
true
1c3c5856bfe266954a44b3aa2ab48c0742a210dc
18,067
py
Python
mklib/tasks.py
ActiveState/mk
2d0afd81ce4e8a3f39885cae5a50ded7bece7f76
[ "MIT" ]
2
2015-12-21T22:35:16.000Z
2017-08-29T14:47:38.000Z
mklib/tasks.py
ActiveState/mk
2d0afd81ce4e8a3f39885cae5a50ded7bece7f76
[ "MIT" ]
1
2020-05-14T12:59:01.000Z
2020-12-11T18:34:07.000Z
mklib/tasks.py
ActiveState/mk
2d0afd81ce4e8a3f39885cae5a50ded7bece7f76
[ "MIT" ]
null
null
null
# Copyright (c) 2005-2007 ActiveState Software Ltd. """Task classes.""" import sys import os from os.path import exists, dirname, abspath, normpath, join import logging import types from mklib.common import * class TaskType(type): """Metaclass for Task's to catch definitions in Makefiles and handle accord...
36.279116
126
0.572757
import sys import os from os.path import exists, dirname, abspath, normpath, join import logging import types from mklib.common import * class TaskType(type): def __init__(cls, name, bases, dct): super(TaskType, cls).__init__(name, bases, dct) if dct["__module__"] != __name__: fra...
true
true
1c3c58d5aa63dd578762930f9b5bf7ff4332eeb8
4,357
py
Python
consoleme/handlers/v2/generate_changes.py
shyovn/consoleme
471592b718b22f83244609ab47d5bf3f9a715a4d
[ "Apache-2.0" ]
2,835
2020-12-09T19:07:24.000Z
2022-03-31T06:38:44.000Z
consoleme/handlers/v2/generate_changes.py
shyovn/consoleme
471592b718b22f83244609ab47d5bf3f9a715a4d
[ "Apache-2.0" ]
179
2020-12-10T01:51:25.000Z
2022-03-31T02:06:06.000Z
consoleme/handlers/v2/generate_changes.py
shyovn/consoleme
471592b718b22f83244609ab47d5bf3f9a715a4d
[ "Apache-2.0" ]
219
2020-12-09T21:30:56.000Z
2022-03-31T05:57:36.000Z
import sys import sentry_sdk from pydantic import ValidationError from consoleme.config import config from consoleme.exceptions.exceptions import InvalidRequestParameter from consoleme.handlers.base import BaseAPIV2Handler from consoleme.lib.change_request import generate_change_model_array from consoleme.lib.plugins...
37.239316
107
0.556346
import sys import sentry_sdk from pydantic import ValidationError from consoleme.config import config from consoleme.exceptions.exceptions import InvalidRequestParameter from consoleme.handlers.base import BaseAPIV2Handler from consoleme.lib.change_request import generate_change_model_array from consoleme.lib.plugins...
true
true
1c3c59272f0b216c9e1a63e8019a1742ca1d1695
418
py
Python
jobs/models.py
bharatchanddandamudi/Bharatchand_Portfolio_V1.1-deploy-
21205ec9d3263463b43422b4679b9736142f7308
[ "MIT" ]
null
null
null
jobs/models.py
bharatchanddandamudi/Bharatchand_Portfolio_V1.1-deploy-
21205ec9d3263463b43422b4679b9736142f7308
[ "MIT" ]
null
null
null
jobs/models.py
bharatchanddandamudi/Bharatchand_Portfolio_V1.1-deploy-
21205ec9d3263463b43422b4679b9736142f7308
[ "MIT" ]
null
null
null
from django.db import models from django.urls import reverse # Create your models here. class Job(models.Model): image = models.ImageField(upload_to='images/') summary = models.CharField(max_length=5000) # video = models.FileField(upload_to='images/',null=True) def __str__(self): return self...
24.588235
61
0.696172
from django.db import models from django.urls import reverse class Job(models.Model): image = models.ImageField(upload_to='images/') summary = models.CharField(max_length=5000) def __str__(self): return self.summary def get_absolute_url(self): return reverse('links', kwargs={"...
true
true
1c3c595ef0b86a94121f9cb02a0e60c0c392bebe
3,673
py
Python
cortex/mapper/samplers.py
mvdoc/pycortex
bc8a93cac9518e3c1cd89650c703f9f3814e805b
[ "BSD-2-Clause" ]
423
2015-01-06T02:46:46.000Z
2022-03-23T17:20:38.000Z
cortex/mapper/samplers.py
mvdoc/pycortex
bc8a93cac9518e3c1cd89650c703f9f3814e805b
[ "BSD-2-Clause" ]
243
2015-01-03T02:10:03.000Z
2022-03-31T19:29:48.000Z
cortex/mapper/samplers.py
mvdoc/pycortex
bc8a93cac9518e3c1cd89650c703f9f3814e805b
[ "BSD-2-Clause" ]
136
2015-03-23T20:35:59.000Z
2022-03-09T13:39:10.000Z
import numpy as np def collapse(j, data): """Collapses samples into a single row""" uniques = np.unique(j) return uniques, np.array([data[j == u].sum() for u in uniques]) def nearest(coords, shape, **kwargs): valid = ~(np.isnan(coords).all(1)) valid = np.logical_and(valid, np.logical_and(coords[:,...
36.73
105
0.564661
import numpy as np def collapse(j, data): uniques = np.unique(j) return uniques, np.array([data[j == u].sum() for u in uniques]) def nearest(coords, shape, **kwargs): valid = ~(np.isnan(coords).all(1)) valid = np.logical_and(valid, np.logical_and(coords[:,0] > -.5, coords[:,0] < shape[2]+.5)) vali...
true
true
1c3c59f62db6ebd3d9c62250d075bec1b3a1d338
1,106
py
Python
test/travis_test_wall_stop.py
NaoUsagi/pimouse_run_corridor
ac217dea819dace826f9e39083f2c85084ab02bf
[ "BSD-3-Clause" ]
null
null
null
test/travis_test_wall_stop.py
NaoUsagi/pimouse_run_corridor
ac217dea819dace826f9e39083f2c85084ab02bf
[ "BSD-3-Clause" ]
null
null
null
test/travis_test_wall_stop.py
NaoUsagi/pimouse_run_corridor
ac217dea819dace826f9e39083f2c85084ab02bf
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python import unittest, rostest import rosnode, rospy import time class WallStopTest(unittest.TestCase): def set_and_get(self,lf,ls,rs,rf): with open("/dev/rtlightsensor0","w") as f: f.write("%d %d %d %d\n" % (rf,rs,ls,lf)) time.sleep(0.3) with open("/dev/rtmoto...
31.6
79
0.613924
import unittest, rostest import rosnode, rospy import time class WallStopTest(unittest.TestCase): def set_and_get(self,lf,ls,rs,rf): with open("/dev/rtlightsensor0","w") as f: f.write("%d %d %d %d\n" % (rf,rs,ls,lf)) time.sleep(0.3) with open("/dev/rtmotor_raw_l0","r") as lf,...
true
true
1c3c5a046b6fcd87fb0f3de3efd5563e6f04c068
2,444
py
Python
main_investment.py
ginkgodango/lgs1
d683c4b9aa620a14862d7ff961c6b3a0e6720507
[ "MIT" ]
null
null
null
main_investment.py
ginkgodango/lgs1
d683c4b9aa620a14862d7ff961c6b3a0e6720507
[ "MIT" ]
null
null
null
main_investment.py
ginkgodango/lgs1
d683c4b9aa620a14862d7ff961c6b3a0e6720507
[ "MIT" ]
null
null
null
import datetime as dt import pandas as pd import investment.extraction directory = 'D:/automation/final/investment/2019/04/' update_filename = 'LGSS Preliminary Performance April 2019_Addkeys.xlsx' returns_filename = 'returns_NOF_201903.csv' market_values_filename = 'market_values_NOF_201903.csv' table_filename = 'tab...
44.436364
122
0.837152
import datetime as dt import pandas as pd import investment.extraction directory = 'D:/automation/final/investment/2019/04/' update_filename = 'LGSS Preliminary Performance April 2019_Addkeys.xlsx' returns_filename = 'returns_NOF_201903.csv' market_values_filename = 'market_values_NOF_201903.csv' table_filename = 'tab...
true
true
1c3c5a1d897bb010f0311515c616d2600ee219ca
9,661
py
Python
gomatic/go_cd_configurator.py
agsmorodin/gomatic
e6ae871ffc2d027823f6b7a5755e0ac65c724538
[ "MIT" ]
null
null
null
gomatic/go_cd_configurator.py
agsmorodin/gomatic
e6ae871ffc2d027823f6b7a5755e0ac65c724538
[ "MIT" ]
null
null
null
gomatic/go_cd_configurator.py
agsmorodin/gomatic
e6ae871ffc2d027823f6b7a5755e0ac65c724538
[ "MIT" ]
null
null
null
#!/usr/bin/env python import json import xml.etree.ElementTree as ET import argparse import sys import subprocess import requests from decimal import Decimal from gomatic.gocd.pipelines import Pipeline, PipelineGroup from gomatic.gocd.agents import Agent from gomatic.xml_operations import Ensurance, PossiblyMissingEle...
38.799197
152
0.686368
import json import xml.etree.ElementTree as ET import argparse import sys import subprocess import requests from decimal import Decimal from gomatic.gocd.pipelines import Pipeline, PipelineGroup from gomatic.gocd.agents import Agent from gomatic.xml_operations import Ensurance, PossiblyMissingElement, move_all_to_end...
true
true
1c3c5afa6632336d33ed6b321487b86832d026ae
4,065
py
Python
pypyr/pypeloaders/fileloader.py
Reskov/pypyr
67bc1795493c19e648e12f776a644f92e3bd2fc8
[ "Apache-2.0" ]
261
2020-08-18T19:31:29.000Z
2022-03-31T14:54:06.000Z
pypyr/pypeloaders/fileloader.py
Reskov/pypyr
67bc1795493c19e648e12f776a644f92e3bd2fc8
[ "Apache-2.0" ]
73
2020-08-14T20:21:14.000Z
2022-03-14T14:00:16.000Z
pypyr/pypeloaders/fileloader.py
Reskov/pypyr
67bc1795493c19e648e12f776a644f92e3bd2fc8
[ "Apache-2.0" ]
15
2020-09-30T12:15:50.000Z
2022-03-30T07:25:40.000Z
"""Load pipelines from local disk.""" import logging from pathlib import Path from pypyr.errors import PipelineNotFoundError import pypyr.moduleloader import pypyr.yaml # use pypyr logger to ensure loglevel is set correctly logger = logging.getLogger(__name__) def get_pipeline_path(pipeline_name, working_directory):...
34.449153
79
0.620664
import logging from pathlib import Path from pypyr.errors import PipelineNotFoundError import pypyr.moduleloader import pypyr.yaml logger = logging.getLogger(__name__) def get_pipeline_path(pipeline_name, working_directory): logger.debug("starting") logger.debug("current directory is %s", working_directory...
true
true
1c3c5b7932954857a06da420ba2524c3d10844c8
37,786
py
Python
ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
dawnwish/ambari
accbb0048435de2d08e3d1b8771d966a94b98707
[ "Apache-2.0" ]
16
2018-05-24T10:28:24.000Z
2021-08-05T03:13:26.000Z
ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
cas-packone/ambari-chs
68033fbd4b810b6642853f2ad9128cbbd4e0cb7b
[ "Apache-2.0" ]
1
2018-10-22T17:50:00.000Z
2018-10-22T17:50:00.000Z
ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
cas-packone/ambari-chs
68033fbd4b810b6642853f2ad9128cbbd4e0cb7b
[ "Apache-2.0" ]
17
2018-07-06T08:57:00.000Z
2021-11-04T11:00:36.000Z
#!/usr/bin/env python ''' 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")...
51.409524
247
0.592389
''' 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 use thi...
false
true
1c3c5bbc9ba1d110481c61250a3be4239d7529bf
406
py
Python
config/wsgi.py
adrianeriksen/photographic
5418a6a79850fa887242f273a35ef9ab585d9d1a
[ "MIT" ]
null
null
null
config/wsgi.py
adrianeriksen/photographic
5418a6a79850fa887242f273a35ef9ab585d9d1a
[ "MIT" ]
6
2021-04-25T08:10:51.000Z
2021-05-25T17:58:32.000Z
config/wsgi.py
adrianeriksen/photographic
5418a6a79850fa887242f273a35ef9ab585d9d1a
[ "MIT" ]
null
null
null
""" WSGI config for photographic project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_...
23.882353
78
0.79064
import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.production") application = get_wsgi_application()
true
true
1c3c5d02b0e2c1b7cbfc4bc0c09678f02680ae2e
10,820
py
Python
label_studio_withoutsignin/core/old_ls_migration.py
DimaVinnitsa/label-studio
b33ef9edc5efef5f5a073e3a457832278afbf2cf
[ "Apache-2.0" ]
null
null
null
label_studio_withoutsignin/core/old_ls_migration.py
DimaVinnitsa/label-studio
b33ef9edc5efef5f5a073e3a457832278afbf2cf
[ "Apache-2.0" ]
null
null
null
label_studio_withoutsignin/core/old_ls_migration.py
DimaVinnitsa/label-studio
b33ef9edc5efef5f5a073e3a457832278afbf2cf
[ "Apache-2.0" ]
null
null
null
import pathlib import contextlib import datetime import os import io import json from tasks.models import Task, Annotation, Prediction from projects.models import Project from data_import.models import FileUpload from core.utils.io import get_data_dir from data_manager.models import View, FilterGroup, Filter from dja...
42.265625
96
0.559242
import pathlib import contextlib import datetime import os import io import json from tasks.models import Task, Annotation, Prediction from projects.models import Project from data_import.models import FileUpload from core.utils.io import get_data_dir from data_manager.models import View, FilterGroup, Filter from dja...
true
true
1c3c5d2b302fee99010bdaefc87f51c40da85f06
3,552
py
Python
bindings/python/ensmallen/datasets/string/buchneraaphidicolabcc.py
AnacletoLAB/ensmallen_graph
b2c1b18fb1e5801712852bcc239f239e03076f09
[ "MIT" ]
5
2021-02-17T00:44:45.000Z
2021-08-09T16:41:47.000Z
bindings/python/ensmallen/datasets/string/buchneraaphidicolabcc.py
AnacletoLAB/ensmallen_graph
b2c1b18fb1e5801712852bcc239f239e03076f09
[ "MIT" ]
18
2021-01-07T16:47:39.000Z
2021-08-12T21:51:32.000Z
bindings/python/ensmallen/datasets/string/buchneraaphidicolabcc.py
AnacletoLAB/ensmallen
b2c1b18fb1e5801712852bcc239f239e03076f09
[ "MIT" ]
3
2021-01-14T02:20:59.000Z
2021-08-04T19:09:52.000Z
""" This file offers the methods to automatically retrieve the graph Buchnera aphidicola BCc. The graph is automatically retrieved from the STRING repository. References --------------------- Please cite the following if you use the data: ```bib @article{szklarczyk2019string, title={STRING v11: protein--protei...
32.888889
223
0.677083
from typing import Dict from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph from ...ensmallen import Graph def BuchneraAphidicolaBcc( directed: bool = False, preprocess: bool = True, load_nodes: bool = True, verbose: int = 2, cache: bool = True, cache_path: str = "graphs/str...
true
true
1c3c5da7ca43b5a9e32c72610052150094a17417
20,518
py
Python
roxbot/cogs/image.py
rdnetto/roxbot
8b59126272704ffbb0986b3b410502a4ea9cb2ed
[ "MIT" ]
23
2018-05-07T11:04:27.000Z
2021-03-19T15:26:04.000Z
roxbot/cogs/image.py
rdnetto/roxbot
8b59126272704ffbb0986b3b410502a4ea9cb2ed
[ "MIT" ]
56
2018-05-27T20:35:42.000Z
2021-08-11T13:29:44.000Z
roxbot/cogs/image.py
rdnetto/roxbot
8b59126272704ffbb0986b3b410502a4ea9cb2ed
[ "MIT" ]
8
2018-04-15T11:32:57.000Z
2021-05-13T16:40:34.000Z
# -*- coding: utf-8 -*- # MIT License # # Copyright (c) 2017-2018 Roxanne Gibson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the right...
34.311037
123
0.571937
import math import os import random import discord import numpy as np from PIL import Image, ImageEnhance from discord.ext import commands import roxbot class Flag: def __init__(self, colours=None, ratio=None, name=""): self.name = name self.rows = len(colours) s...
true
true
1c3c5e4eadf2c53254f474f792f65053d7dd8804
1,105
py
Python
setup.py
sprymix/csscompressor
0857438db725d5c1d2672f45d9cf3e7dc14646a4
[ "BSD-3-Clause" ]
38
2015-05-22T18:55:52.000Z
2022-03-05T21:18:58.000Z
setup.py
sprymix/csscompressor
0857438db725d5c1d2672f45d9cf3e7dc14646a4
[ "BSD-3-Clause" ]
8
2015-08-18T04:31:11.000Z
2022-01-28T16:55:33.000Z
setup.py
sprymix/csscompressor
0857438db725d5c1d2672f45d9cf3e7dc14646a4
[ "BSD-3-Clause" ]
10
2015-01-04T14:14:05.000Z
2020-09-03T18:32:02.000Z
from setuptools import setup extra = {} f = open('README.rst', 'r') try: extra['long_description'] = f.read() finally: f.close() deps = [] try: import argparse except ImportError: deps.append('argparse') setup( name='csscompressor', version='0.9.5', url='http://github.com/sprymix/cssco...
25.113636
55
0.611765
from setuptools import setup extra = {} f = open('README.rst', 'r') try: extra['long_description'] = f.read() finally: f.close() deps = [] try: import argparse except ImportError: deps.append('argparse') setup( name='csscompressor', version='0.9.5', url='http://github.com/sprymix/cssco...
true
true
1c3c5ec734fa76d1985b40465b2b2eedcf0269a3
973
py
Python
capa/features/basicblock.py
clayne/capa
e47f5a2548443509b0f7f251fb10ae3eadb34a88
[ "Apache-2.0" ]
1,887
2020-07-16T19:43:23.000Z
2021-09-23T08:40:43.000Z
capa/features/basicblock.py
clayne/capa
e47f5a2548443509b0f7f251fb10ae3eadb34a88
[ "Apache-2.0" ]
440
2020-07-16T19:02:32.000Z
2021-09-23T08:46:44.000Z
capa/features/basicblock.py
clayne/capa
e47f5a2548443509b0f7f251fb10ae3eadb34a88
[ "Apache-2.0" ]
304
2020-07-16T19:45:49.000Z
2021-09-18T00:15:41.000Z
# Copyright (C) 2020 Mandiant, Inc. All Rights Reserved. # 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: [package root]/LICENSE.txt # Unless required by applicable law or agreed to in writing...
34.75
111
0.722508
from capa.features.common import Feature class BasicBlock(Feature): def __init__(self): super(BasicBlock, self).__init__(None) def __str__(self): return "basic block" def get_value_str(self): return "" def freeze_serialize(self): return (self.__class__.__name...
true
true
1c3c5f7137ddcdfb0b5c4fed0f3ddf3de7a4ad13
2,525
py
Python
cookbook/core/flyte_basics/task_cache.py
mayitbeegh/flytesnacks
35fe9db45f08fce3d94923b4245b1a9980a915ef
[ "Apache-2.0" ]
null
null
null
cookbook/core/flyte_basics/task_cache.py
mayitbeegh/flytesnacks
35fe9db45f08fce3d94923b4245b1a9980a915ef
[ "Apache-2.0" ]
18
2021-08-25T15:15:22.000Z
2022-03-12T01:03:57.000Z
cookbook/core/flyte_basics/task_cache.py
mayitbeegh/flytesnacks
35fe9db45f08fce3d94923b4245b1a9980a915ef
[ "Apache-2.0" ]
null
null
null
""" Task Cache ---------------- Flyte provides the ability to cache the output of task executions in order to make subsequent executions faster. A well-behaved Flyte Task should generate deterministic output given the same inputs and task functionality. This is useful in situations where a user knows that many executi...
51.530612
226
0.746931
from flytekit import task @task(cache=True, cache_version="1.0") def square(n: int) -> int: return n * n # available immediately - (captured from the previous execution with the same inputs) # %% # If, in a subsequent code update, we update the signature of the task to return the original number alo...
true
true
1c3c611fd2af26ab78c550681c1a8f287ba0b2b0
4,246
py
Python
motion_plan/scripts/moving_tow_point_autonomus.py
Blackcipher101/Autonoums-navigatation
d00eded10bd9c1199d555a7fd355d19112dd7466
[ "Unlicense" ]
4
2020-06-10T09:36:00.000Z
2020-08-27T15:37:23.000Z
motion_plan/scripts/moving_tow_point_autonomus.py
Blackcipher101/Autonoums-navigatation
d00eded10bd9c1199d555a7fd355d19112dd7466
[ "Unlicense" ]
null
null
null
motion_plan/scripts/moving_tow_point_autonomus.py
Blackcipher101/Autonoums-navigatation
d00eded10bd9c1199d555a7fd355d19112dd7466
[ "Unlicense" ]
null
null
null
#! /usr/bin/env python import rospy import math import cv2 import socket from nav_msgs.msg import Odometry from cv_bridge import CvBridge, CvBridgeError from sensor_msgs.msg import LaserScan, Image from geometry_msgs.msg import Twist pub = None bridge = CvBridge() flag=1 regions={} angular_z=0 #backSub = cv2.createBack...
29.082192
122
0.614461
import rospy import math import cv2 import socket from nav_msgs.msg import Odometry from cv_bridge import CvBridge, CvBridgeError from sensor_msgs.msg import LaserScan, Image from geometry_msgs.msg import Twist pub = None bridge = CvBridge() flag=1 regions={} angular_z=0 Received=0 move_to_x=7 move_to_y=7 def image_c...
false
true
1c3c61feb17b029e6e68fc2b7b1aaca37fae0aed
675
py
Python
doc/source/devel/examples/label04.py
MikeFalowski/taurus
ef041bf35dd847caf08a7efbe072f4020d35522e
[ "CC-BY-3.0" ]
null
null
null
doc/source/devel/examples/label04.py
MikeFalowski/taurus
ef041bf35dd847caf08a7efbe072f4020d35522e
[ "CC-BY-3.0" ]
1
2020-02-28T16:36:04.000Z
2020-03-02T07:51:12.000Z
doc/source/devel/examples/label04.py
MikeFalowski/taurus
ef041bf35dd847caf08a7efbe072f4020d35522e
[ "CC-BY-3.0" ]
null
null
null
import sys from taurus.external.qt import Qt from taurus.qt.qtgui.container import TaurusWidget from taurus.qt.qtgui.display import TaurusLabel from taurus.qt.qtgui.application import TaurusApplication app = TaurusApplication(sys.argv, cmd_line_parser=None) panel = TaurusWidget() layout = Qt.QVBoxLayout() panel.setLay...
25.961538
57
0.794074
import sys from taurus.external.qt import Qt from taurus.qt.qtgui.container import TaurusWidget from taurus.qt.qtgui.display import TaurusLabel from taurus.qt.qtgui.application import TaurusApplication app = TaurusApplication(sys.argv, cmd_line_parser=None) panel = TaurusWidget() layout = Qt.QVBoxLayout() panel.setLay...
true
true
1c3c6255f57d07dd08df4f7ffbc40ddf5b4d0cbe
3,143
py
Python
compro/atcoder_problems/fetch_specific_difficulty_problem_lists.py
tsutaj/sandbox
c7046f2973ce23f84085c6697c6752483cdcda71
[ "MIT" ]
null
null
null
compro/atcoder_problems/fetch_specific_difficulty_problem_lists.py
tsutaj/sandbox
c7046f2973ce23f84085c6697c6752483cdcda71
[ "MIT" ]
null
null
null
compro/atcoder_problems/fetch_specific_difficulty_problem_lists.py
tsutaj/sandbox
c7046f2973ce23f84085c6697c6752483cdcda71
[ "MIT" ]
null
null
null
import argparse import logging import pandas as pd import pathlib import requests diff_info = ("https://kenkoooo.com/atcoder/resources/problem-models.json", "./difficulty.json") prob_info = ("https://kenkoooo.com/atcoder/resources/problems.json", "./problems.json") result_json_info = ("hoge", "./result.json") result_c...
31.747475
108
0.655425
import argparse import logging import pandas as pd import pathlib import requests diff_info = ("https://kenkoooo.com/atcoder/resources/problem-models.json", "./difficulty.json") prob_info = ("https://kenkoooo.com/atcoder/resources/problems.json", "./problems.json") result_json_info = ("hoge", "./result.json") result_c...
true
true
1c3c62f47a08a5db3dccc4e6fb2f59b512a6b691
4,567
py
Python
gdsfactory/types.py
gdsfactory/gdsfactory
e53b1f3415a81862d465e0443fc09fb35d14d1e0
[ "MIT" ]
42
2020-05-25T09:33:45.000Z
2022-03-29T03:41:19.000Z
gdsfactory/types.py
gdsfactory/gdsfactory
e53b1f3415a81862d465e0443fc09fb35d14d1e0
[ "MIT" ]
133
2020-05-28T18:29:04.000Z
2022-03-31T22:21:42.000Z
gdsfactory/types.py
gdsfactory/gdsfactory
e53b1f3415a81862d465e0443fc09fb35d14d1e0
[ "MIT" ]
17
2020-06-30T07:07:50.000Z
2022-03-17T15:45:27.000Z
"""In programming, a factory is a function that returns an Object. Functions are easy to understand because they have clear inputs and outputs. Most gdsfactory functions take some inputs and return a Component object. Some of these inputs parameters are also functions. - Component: Object with. - name - refer...
25.948864
86
0.696737
import json import pathlib from typing import Any, Callable, Dict, List, Optional, Tuple, Union from omegaconf import OmegaConf from phidl.device_layout import Label as LabelPhidl from phidl.device_layout import Path from pydantic import BaseModel from typing_extensions import Literal from gdsfactory.component import...
true
true
1c3c6328ae82c26dbaf6b705307a78e18c87d06a
1,529
py
Python
example/router2x.py
shiyanhui/Router
df5974fec264345920ab1ed54b043493882e558f
[ "MIT" ]
10
2017-11-26T03:01:07.000Z
2021-12-02T03:56:31.000Z
example/router2x.py
shiyanhui/Router
df5974fec264345920ab1ed54b043493882e558f
[ "MIT" ]
1
2020-11-30T16:40:00.000Z
2020-11-30T16:40:00.000Z
example/router2x.py
shiyanhui/Router
df5974fec264345920ab1ed54b043493882e558f
[ "MIT" ]
4
2018-03-19T10:01:39.000Z
2020-11-30T17:05:05.000Z
# -*- coding: utf-8 -*- """ An Router example that in Python2.x """ from router import BaseRouter, cleanPath, toggleTrailingSlash class Router(BaseRouter): def __init__(self, redirectTrailingSlash=True, fixRequestPath=True, notFoundHandler=None, methodNotAllowedHandler=None): self.re...
29.980392
71
0.583388
from router import BaseRouter, cleanPath, toggleTrailingSlash class Router(BaseRouter): def __init__(self, redirectTrailingSlash=True, fixRequestPath=True, notFoundHandler=None, methodNotAllowedHandler=None): self.redirectTrailingSlash = redirectTrailingSlash self.fixRequestPath...
true
true
1c3c6347aadaf337888eac53824915f4d798e2bb
500
py
Python
pythonUtils/ExploreDA/SummaryStatistics/utils.py
tgquintela/pythonUtils
6f2e5ba3be67a48d3cd5cf72dcabfae04cfa7afe
[ "MIT" ]
1
2015-07-21T05:15:11.000Z
2015-07-21T05:15:11.000Z
pythonUtils/ExploreDA/SummaryStatistics/utils.py
tgquintela/pythonUtils
6f2e5ba3be67a48d3cd5cf72dcabfae04cfa7afe
[ "MIT" ]
null
null
null
pythonUtils/ExploreDA/SummaryStatistics/utils.py
tgquintela/pythonUtils
6f2e5ba3be67a48d3cd5cf72dcabfae04cfa7afe
[ "MIT" ]
null
null
null
""" Utils ----- Statistics utils. """ def clean_dict_stats(stats): """Cleaner dict stats information. That function removes the plots stored in the stats dictionary data base. Parameters ---------- stats: dict the stats dictionary database. Returns ------- stats: dict ...
16.666667
77
0.588
def clean_dict_stats(stats): for i in range(len(stats)): if 'plots' in stats[i].keys(): del stats[i]['plots'] return stats
true
true
1c3c64dfbceee8a6e3fb2a0c39151dcdfa6ec219
522
py
Python
air_hockey/game/scripting/change_scene_action.py
Nemo3003/cse210-06
30ecefac7f23927be904f48b29492bb2220262a8
[ "Apache-2.0" ]
null
null
null
air_hockey/game/scripting/change_scene_action.py
Nemo3003/cse210-06
30ecefac7f23927be904f48b29492bb2220262a8
[ "Apache-2.0" ]
null
null
null
air_hockey/game/scripting/change_scene_action.py
Nemo3003/cse210-06
30ecefac7f23927be904f48b29492bb2220262a8
[ "Apache-2.0" ]
null
null
null
from constants import * from game.scripting.action import Action """ In order to have a coherent game you need to change scenes constantly...that is what this module is for :) """ class ChangeSceneAction(Action): def __init__(self, keyboard_service, next_scene): self._keyboard_service = keyboard_serv...
30.705882
110
0.710728
from constants import * from game.scripting.action import Action class ChangeSceneAction(Action): def __init__(self, keyboard_service, next_scene): self._keyboard_service = keyboard_service self._next_scene = next_scene def execute(self, cast, script, callback): if self._keyb...
true
true
1c3c66e744866def3414627e0860c3e0a5367fd9
2,580
py
Python
plugins/checkdmarc/icon_checkdmarc/actions/check_domains_alternate_nameservers/schema.py
lukaszlaszuk/insightconnect-plugins
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
[ "MIT" ]
46
2019-06-05T20:47:58.000Z
2022-03-29T10:18:01.000Z
plugins/checkdmarc/icon_checkdmarc/actions/check_domains_alternate_nameservers/schema.py
lukaszlaszuk/insightconnect-plugins
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
[ "MIT" ]
386
2019-06-07T20:20:39.000Z
2022-03-30T17:35:01.000Z
plugins/checkdmarc/icon_checkdmarc/actions/check_domains_alternate_nameservers/schema.py
lukaszlaszuk/insightconnect-plugins
8c6ce323bfbb12c55f8b5a9c08975d25eb9f8892
[ "MIT" ]
43
2019-07-09T14:13:58.000Z
2022-03-28T12:04:46.000Z
# GENERATED BY KOMAND SDK - DO NOT EDIT import komand import json class Component: DESCRIPTION = "Check DMARC records against alternate name servers" class Input: DOMAIN = "domain" NAMESERVERS = "nameservers" TIMEOUT = "timeout" class Output: REPORT = "report" class CheckDomainsAlter...
20.314961
76
0.471318
import komand import json class Component: DESCRIPTION = "Check DMARC records against alternate name servers" class Input: DOMAIN = "domain" NAMESERVERS = "nameservers" TIMEOUT = "timeout" class Output: REPORT = "report" class CheckDomainsAlternateNameserversInput(komand.Input): ...
true
true
1c3c67aa1d0b25d633f496477aa384d08de4b753
2,963
py
Python
jacket/tests/storage/functional/api/foxinsocks.py
bopopescu/jacket
d7ad3147fcb43131098c2a5210847634ff5fb325
[ "Apache-2.0" ]
null
null
null
jacket/tests/storage/functional/api/foxinsocks.py
bopopescu/jacket
d7ad3147fcb43131098c2a5210847634ff5fb325
[ "Apache-2.0" ]
null
null
null
jacket/tests/storage/functional/api/foxinsocks.py
bopopescu/jacket
d7ad3147fcb43131098c2a5210847634ff5fb325
[ "Apache-2.0" ]
2
2016-08-10T02:21:49.000Z
2020-07-24T01:57:21.000Z
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # 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 requ...
32.206522
78
0.674992
import webob.exc from jacket.api.storage.storage import extensions from jacket.api.storage.storage.openstack import wsgi class FoxInSocksController(object): def index(self, req): return "Try to say this Mr. Knox, sir..." class FoxInSocksServerControllerExtension(wsgi.Controller): @w...
true
true
1c3c69279c6b1c2b47c8f13643a440eab54b9347
1,026
py
Python
land-queue/main.py
bootstraponline/python
fe984fe3d6c1f49ad5b3e70a1cbe450466b46da3
[ "Apache-2.0" ]
null
null
null
land-queue/main.py
bootstraponline/python
fe984fe3d6c1f49ad5b3e70a1cbe450466b46da3
[ "Apache-2.0" ]
null
null
null
land-queue/main.py
bootstraponline/python
fe984fe3d6c1f49ad5b3e70a1cbe450466b46da3
[ "Apache-2.0" ]
null
null
null
from flask import Flask, request, Response import octohook from octohook.events import PullRequestEvent from octohook.models import PullRequest, Repository app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): # X-GitHub-Event contains an event type defined here: https://developer.github....
27.72973
96
0.701754
from flask import Flask, request, Response import octohook from octohook.events import PullRequestEvent from octohook.models import PullRequest, Repository app = Flask(__name__) @app.route('/webhook', methods=['POST']) def webhook(): github_event = request.headers.get('X-GitHub-Event') if github_e...
true
true
1c3c69a01bcab218da4da5a072bc2ad21afe55f8
8,896
py
Python
tests/unit/modules/test_at.py
nevins-b/salt
56363bc41ca36e757103df3504d1bb07e3a7251b
[ "Apache-2.0" ]
null
null
null
tests/unit/modules/test_at.py
nevins-b/salt
56363bc41ca36e757103df3504d1bb07e3a7251b
[ "Apache-2.0" ]
null
null
null
tests/unit/modules/test_at.py
nevins-b/salt
56363bc41ca36e757103df3504d1bb07e3a7251b
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Rupesh Tare <rupesht@saltstack.com>` ''' # Import Python libs from __future__ import absolute_import # Import Salt Testing Libs from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase, skipIf from tests.support.mock import ( ...
43.607843
79
0.437388
from __future__ import absolute_import from tests.support.mixins import LoaderModuleMockMixin from tests.support.unit import TestCase, skipIf from tests.support.mock import ( MagicMock, patch, NO_MOCK, NO_MOCK_REASON ) import salt.utils import salt.modules.at as at @skipIf(NO_MOCK, NO_MOCK_REAS...
true
true
1c3c69b936dcc5734222d1aea08bd31bc4e801ef
268
py
Python
BMI.py
olgarozhdestvina/pands-problems
f6593d340c6b3d18254658248507e7b3a98ac10a
[ "MIT" ]
null
null
null
BMI.py
olgarozhdestvina/pands-problems
f6593d340c6b3d18254658248507e7b3a98ac10a
[ "MIT" ]
null
null
null
BMI.py
olgarozhdestvina/pands-problems
f6593d340c6b3d18254658248507e7b3a98ac10a
[ "MIT" ]
null
null
null
# This program calculates your Body Mass Index (BMI) height = float (input("Enter your height in cm: ")) weight = float (input("Enter your weight in kg: ")) squareOfHeight = height ** 2 / 10000 BMI = weight / squareOfHeight print("Your BMI is {:.2f}".format(BMI))
29.777778
52
0.690299
height = float (input("Enter your height in cm: ")) weight = float (input("Enter your weight in kg: ")) squareOfHeight = height ** 2 / 10000 BMI = weight / squareOfHeight print("Your BMI is {:.2f}".format(BMI))
true
true
1c3c69d7951b3ed9aac8b92f8a418eb8a3e56d7c
1,145
py
Python
Lib/site-packages/pylint/testutils/constants.py
edupyter/EDUPYTER38
396183cea72987506f1ef647c0272a2577c56218
[ "bzip2-1.0.6" ]
null
null
null
Lib/site-packages/pylint/testutils/constants.py
edupyter/EDUPYTER38
396183cea72987506f1ef647c0272a2577c56218
[ "bzip2-1.0.6" ]
null
null
null
Lib/site-packages/pylint/testutils/constants.py
edupyter/EDUPYTER38
396183cea72987506f1ef647c0272a2577c56218
[ "bzip2-1.0.6" ]
null
null
null
# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/main/LICENSE # Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt import operator import re import sys from pathlib import Path SYS_VERS_STR = ( "%d%d%d" % sys...
38.166667
87
0.652402
import operator import re import sys from pathlib import Path SYS_VERS_STR = ( "%d%d%d" % sys.version_info[:3] ) TITLE_UNDERLINES = ["", "=", "-", "."] UPDATE_OPTION = "--update-functional-output" UPDATE_FILE = Path("pylint-functional-test-update") _MESSAGE = {"msg": r"[a-z][a-z\-]+"} _EXPECTED_RE = re.c...
true
true
1c3c6b3e9b128d11073c24674f64b5a9e881cfdb
7,639
py
Python
openprescribing/frontend/management/commands/infer_practice_boundaries.py
annapowellsmith/openpresc
cfa9fb07d6fc2ee304159c04fcc132cefcf78745
[ "MIT" ]
null
null
null
openprescribing/frontend/management/commands/infer_practice_boundaries.py
annapowellsmith/openpresc
cfa9fb07d6fc2ee304159c04fcc132cefcf78745
[ "MIT" ]
null
null
null
openprescribing/frontend/management/commands/infer_practice_boundaries.py
annapowellsmith/openpresc
cfa9fb07d6fc2ee304159c04fcc132cefcf78745
[ "MIT" ]
null
null
null
""" Infer boundaries for practices from their locations using a Voronoi partition (i.e. assign each point in the country to its closest practice) These boundaries have no real meaning but they're easy enough to explain and they allow us to render plausible-looking maps for arbitrary collections of practices. The boun...
38.580808
88
0.679277
import os import random import string from django.conf import settings from django.contrib.gis.db.models import Collect, Union from django.contrib.gis.geos import GEOSException, GEOSGeometry, MultiPolygon, Polygon from django.core.management.base import BaseCommand from django.db import connection, transaction from dj...
true
true
1c3c6bdcdaeb74ab1e9d878a49b0c9660f5344cb
1,836
py
Python
HCA_In_and_Out/Q_In_and_Out_orig.py
hotchilianalytics/hca-resources
051fcad7bf94ff0b7543adb227a769f0b9cead67
[ "Apache-2.0" ]
2
2022-02-22T12:46:48.000Z
2022-03-28T21:58:13.000Z
HCA_In_and_Out/Q_In_and_Out_orig.py
hotchilianalytics/hca-resources
051fcad7bf94ff0b7543adb227a769f0b9cead67
[ "Apache-2.0" ]
null
null
null
HCA_In_and_Out/Q_In_and_Out_orig.py
hotchilianalytics/hca-resources
051fcad7bf94ff0b7543adb227a769f0b9cead67
[ "Apache-2.0" ]
6
2021-05-26T14:56:40.000Z
2022-02-14T15:56:27.000Z
# Vlad Code from: Aleksei Dremov in # https://www.quantopian.com/posts/live-slash-paper-trade-the-in-out-stragegy # Price relative ratios (intersection) with wait days import numpy as np # ----------------------------------------------------------------------------------------------- STOCKS = symbols('QQQ'); BONDS = ...
51
97
0.568083
import numpy as np STOCKS = symbols('QQQ'); BONDS = symbols('TLT','IEF'); LEV = 1.00; wt = {}; A = symbol('SLV'); B = symbol('GLD'); C = symbol('XLI'); D = symbol('XLU'); MKT = symbol('QQQ'); VOLA = 126; LB = 1.00; BULL = 1; COUNT = 0; OUT_DAY = 0; RET_INITIAL = 80; def initialize(context): schedule_function(...
true
true
1c3c6c0e4797303db7b5ac6091ee96eacc4c40da
2,386
py
Python
tools/c7n_gcp/tests/test_notify_gcp.py
al3pht/cloud-custodian
ce6613d1b716f336384c5e308eee300389e6bf50
[ "Apache-2.0" ]
2
2022-02-16T07:45:20.000Z
2022-02-19T10:25:30.000Z
tools/c7n_gcp/tests/test_notify_gcp.py
al3pht/cloud-custodian
ce6613d1b716f336384c5e308eee300389e6bf50
[ "Apache-2.0" ]
28
2020-09-23T03:56:48.000Z
2021-04-21T19:08:55.000Z
tools/c7n_gcp/tests/test_notify_gcp.py
lfranchini31/cloud-custodian
1830fe4b9a59ff6afb675985c9ea531571616a76
[ "Apache-2.0" ]
9
2019-11-18T07:46:44.000Z
2020-04-15T11:20:20.000Z
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 from gcp_common import BaseTest from c7n_gcp.client import Session import mock class NotifyTest(BaseTest): def test_pubsub_notify(self): factory = self.replay_flight_data("notify-action") orig_client = Session.clien...
36.151515
92
0.523889
from gcp_common import BaseTest from c7n_gcp.client import Session import mock class NotifyTest(BaseTest): def test_pubsub_notify(self): factory = self.replay_flight_data("notify-action") orig_client = Session.client stub_client = mock.MagicMock() calls = [] def clie...
true
true
1c3c6d0902d1556e63c9c900ce2de241056464e4
751
py
Python
tests/instance_testing.py
zachbateman/tracer
03a27113ac3abd888b49a1ea9717a0b7ab2999ce
[ "MIT" ]
null
null
null
tests/instance_testing.py
zachbateman/tracer
03a27113ac3abd888b49a1ea9717a0b7ab2999ce
[ "MIT" ]
null
null
null
tests/instance_testing.py
zachbateman/tracer
03a27113ac3abd888b49a1ea9717a0b7ab2999ce
[ "MIT" ]
null
null
null
# import unittest import sys sys.path.insert(1, '..') import tracer class TestClass(metaclass=tracer.Tracer): def __init__(self): self.value = 0 def add(self, val): self.value += val if val == 5: x = 1 / 0 def subtract(self, val): self.value -= val if __nam...
17.465116
62
0.588549
import sys sys.path.insert(1, '..') import tracer class TestClass(metaclass=tracer.Tracer): def __init__(self): self.value = 0 def add(self, val): self.value += val if val == 5: x = 1 / 0 def subtract(self, val): self.value -= val if __name__ == '__main__'...
true
true
1c3c6d3d8274d50cb8f0d89b2f5f9510d3d2225f
18,223
py
Python
rock/run.py
vita-epfl/rock-pytorch
6f4c86d3fec7fe3b0ce65d2687d144e9698e964f
[ "Apache-2.0" ]
9
2020-06-29T17:21:30.000Z
2022-01-26T08:46:11.000Z
rock/run.py
vita-epfl/rock-pytorch
6f4c86d3fec7fe3b0ce65d2687d144e9698e964f
[ "Apache-2.0" ]
null
null
null
rock/run.py
vita-epfl/rock-pytorch
6f4c86d3fec7fe3b0ce65d2687d144e9698e964f
[ "Apache-2.0" ]
null
null
null
import argparse from typing import Union import torch def int_or_none(value: str) -> Union[None, int]: if value == 'None': return None return int(value) def cli() -> argparse.Namespace: """ Command line interface """ parser = argparse.ArgumentParser() subparsers = parser.add_subpars...
62.194539
121
0.557427
import argparse from typing import Union import torch def int_or_none(value: str) -> Union[None, int]: if value == 'None': return None return int(value) def cli() -> argparse.Namespace: parser = argparse.ArgumentParser() subparsers = parser.add_subparsers(help='Different parsers for main ac...
true
true
1c3c6ec0ce7a0c228603fedba7710e079d0764cc
1,325
py
Python
updatesproducer/tests/mongodb_tests.py
AppleteeYT/Iris
b60deb6575820253bad50b48b9b39023d6440fd4
[ "Apache-2.0" ]
null
null
null
updatesproducer/tests/mongodb_tests.py
AppleteeYT/Iris
b60deb6575820253bad50b48b9b39023d6440fd4
[ "Apache-2.0" ]
null
null
null
updatesproducer/tests/mongodb_tests.py
AppleteeYT/Iris
b60deb6575820253bad50b48b9b39023d6440fd4
[ "Apache-2.0" ]
null
null
null
import json import logging import unittest from datetime import datetime from unittest import TestCase from updatesproducer.db.mongodb_config import MongoDbConfig from updatesproducer.db.updates_repository import UpdatesRepository class MongoDbTests(TestCase): def __init__(self, *args, **kwargs): super(M...
30.113636
69
0.683774
import json import logging import unittest from datetime import datetime from unittest import TestCase from updatesproducer.db.mongodb_config import MongoDbConfig from updatesproducer.db.updates_repository import UpdatesRepository class MongoDbTests(TestCase): def __init__(self, *args, **kwargs): super(M...
true
true
1c3c6f00110fd348675027667b761d5e3bbceed6
62,333
py
Python
src/transformers/models/speech_to_text/modeling_speech_to_text.py
JadeMaveric/transformers
fb2b89840bf2ab9f74702bf83af8ddf92b61efb3
[ "Apache-2.0" ]
34
2021-07-05T02:44:31.000Z
2022-03-28T14:39:57.000Z
src/transformers/models/speech_to_text/modeling_speech_to_text.py
JadeMaveric/transformers
fb2b89840bf2ab9f74702bf83af8ddf92b61efb3
[ "Apache-2.0" ]
3
2021-07-22T15:49:44.000Z
2022-03-19T08:46:27.000Z
src/transformers/models/speech_to_text/modeling_speech_to_text.py
JadeMaveric/transformers
fb2b89840bf2ab9f74702bf83af8ddf92b61efb3
[ "Apache-2.0" ]
6
2021-07-05T02:44:32.000Z
2022-02-14T10:10:13.000Z
# coding=utf-8 # Copyright 2021 The Fairseq Authors and The HuggingFace Inc. team. All rights reserved. # # 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/...
46.070214
239
0.657485
import math import random from typing import Optional, Tuple import torch import torch.nn.functional as F from torch import nn from torch.nn import CrossEntropyLoss from ...activations import ACT2FN from ...file_utils import ( add_code_sample_docstrings, add_start_docstrings, add_start_doc...
true
true
1c3c6f1172e73e35d9a349f5a55c568beb7b1891
7,618
py
Python
scripts/update_schemas.py
felixkj123/bmcweb
91243c3b28b1df66e682f5a3ee96341fdc516b5a
[ "Apache-2.0" ]
null
null
null
scripts/update_schemas.py
felixkj123/bmcweb
91243c3b28b1df66e682f5a3ee96341fdc516b5a
[ "Apache-2.0" ]
null
null
null
scripts/update_schemas.py
felixkj123/bmcweb
91243c3b28b1df66e682f5a3ee96341fdc516b5a
[ "Apache-2.0" ]
1
2021-06-23T10:28:02.000Z
2021-06-23T10:28:02.000Z
#!/usr/bin/python3 import requests import zipfile from io import BytesIO import os from collections import defaultdict from collections import OrderedDict from distutils.version import StrictVersion import shutil import json import glob import xml.etree.ElementTree as ET VERSION = "DSP8010_2019.2" SCRIPT_DIR = os.pa...
40.737968
119
0.582699
import requests import zipfile from io import BytesIO import os from collections import defaultdict from collections import OrderedDict from distutils.version import StrictVersion import shutil import json import glob import xml.etree.ElementTree as ET VERSION = "DSP8010_2019.2" SCRIPT_DIR = os.path.dirname(os.path...
true
true
1c3c7157849f130a209973d405d5e109baa1b505
3,467
py
Python
app.py
mfronistas/LotteryWebAppFiles
7e1a71c4198063f01bf7eca1980826e11787093e
[ "Apache-2.0" ]
null
null
null
app.py
mfronistas/LotteryWebAppFiles
7e1a71c4198063f01bf7eca1980826e11787093e
[ "Apache-2.0" ]
null
null
null
app.py
mfronistas/LotteryWebAppFiles
7e1a71c4198063f01bf7eca1980826e11787093e
[ "Apache-2.0" ]
null
null
null
# IMPORTS import socket from functools import wraps import logging from flask import Flask, render_template, request from flask_login import LoginManager, current_user from flask_sqlalchemy import SQLAlchemy from flask_talisman import Talisman # LOGGING class SecurityFilter(logging.Filter): def filter(self, record...
27.515873
90
0.676954
import socket from functools import wraps import logging from flask import Flask, render_template, request from flask_login import LoginManager, current_user from flask_sqlalchemy import SQLAlchemy from flask_talisman import Talisman class SecurityFilter(logging.Filter): def filter(self, record): return ...
true
true
1c3c732fd1bf32628655f32cb83e5438752c6640
346
py
Python
specification_data_files/www.amwa.tv_c0f7b64/block/989/artefacts/audio_track_layout.py
AMWA-TV/AS-11_UK_DPP_HD
12e100a3de2f60592413a0d21f81f343505e0123
[ "Apache-2.0" ]
2
2020-02-11T12:55:47.000Z
2021-07-03T07:04:09.000Z
specification_data_files/www.amwa.tv_c0f7b64/block/989/artefacts/audio_track_layout.py
AMWA-TV/AS-11_UK_DPP_HD
12e100a3de2f60592413a0d21f81f343505e0123
[ "Apache-2.0" ]
null
null
null
specification_data_files/www.amwa.tv_c0f7b64/block/989/artefacts/audio_track_layout.py
AMWA-TV/AS-11_UK_DPP_HD
12e100a3de2f60592413a0d21f81f343505e0123
[ "Apache-2.0" ]
1
2019-07-14T18:26:16.000Z
2019-07-14T18:26:16.000Z
CHECK( AS_11_Audio_Track_Layout in [Layout_EBU_R_48_2a, Layout_EBU_R_123_4b, Layout_EBU_R_123_4c, Layout_EBU_R_123_16c, Layout_EBU_R_123_16d, ...
49.428571
59
0.424855
CHECK( AS_11_Audio_Track_Layout in [Layout_EBU_R_48_2a, Layout_EBU_R_123_4b, Layout_EBU_R_123_4c, Layout_EBU_R_123_16c, Layout_EBU_R_123_16d, ...
true
true
1c3c73a1a99d2ef2de0e38c64ecbb54c3de9a447
16,577
py
Python
AWERA/power_production/aep_map.py
lthUniBonn/AWERA
fa7f210516318bcfcbe1c99abbb5954b0cbaf682
[ "MIT" ]
null
null
null
AWERA/power_production/aep_map.py
lthUniBonn/AWERA
fa7f210516318bcfcbe1c99abbb5954b0cbaf682
[ "MIT" ]
null
null
null
AWERA/power_production/aep_map.py
lthUniBonn/AWERA
fa7f210516318bcfcbe1c99abbb5954b0cbaf682
[ "MIT" ]
null
null
null
import numpy as np import pandas as pd import pickle import matplotlib as mpl import matplotlib.pyplot as plt import cartopy import cartopy.crs as ccrs from ..utils.plotting_utils import plot_map def get_mask_discontinuities(df): """Identify discontinuities in the power curves. The provided approach is obtai...
39.657895
93
0.563069
import numpy as np import pandas as pd import pickle import matplotlib as mpl import matplotlib.pyplot as plt import cartopy import cartopy.crs as ccrs from ..utils.plotting_utils import plot_map def get_mask_discontinuities(df): mask = np.concatenate(((True,), (np.diff(df['P [W]']) > -5e2))) mask = np.logic...
true
true
1c3c74555d9da04e5e1876e8c8ddebb140e9366d
37,406
py
Python
regtests/soap.py
anjohan/dscribe
9daf60453076d0a18088a5d70deddd737903e665
[ "Apache-2.0" ]
null
null
null
regtests/soap.py
anjohan/dscribe
9daf60453076d0a18088a5d70deddd737903e665
[ "Apache-2.0" ]
null
null
null
regtests/soap.py
anjohan/dscribe
9daf60453076d0a18088a5d70deddd737903e665
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """Copyright 2019 DScribe developers Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agr...
37.631791
169
0.508127
import math import unittest import numpy as np import scipy import scipy.sparse from scipy.integrate import tplquad from scipy.linalg import sqrtm from dscribe.descriptors import SOAP from testbaseclass import TestBaseClass from ase import Atoms from ase.build import molecule H2O = Atoms( cell=[ [1.0...
true
true
1c3c75123408af126c5c4039ef3cbcdf9d6476cc
1,830
py
Python
alipay/aop/api/domain/KoubeiRetailExtitemShopextitemQueryModel.py
snowxmas/alipay-sdk-python-all
96870ced60facd96c5bce18d19371720cbda3317
[ "Apache-2.0" ]
213
2018-08-27T16:49:32.000Z
2021-12-29T04:34:12.000Z
alipay/aop/api/domain/KoubeiRetailExtitemShopextitemQueryModel.py
snowxmas/alipay-sdk-python-all
96870ced60facd96c5bce18d19371720cbda3317
[ "Apache-2.0" ]
29
2018-09-29T06:43:00.000Z
2021-09-02T03:27:32.000Z
alipay/aop/api/domain/KoubeiRetailExtitemShopextitemQueryModel.py
snowxmas/alipay-sdk-python-all
96870ced60facd96c5bce18d19371720cbda3317
[ "Apache-2.0" ]
59
2018-08-27T16:59:26.000Z
2022-03-25T10:08:15.000Z
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class KoubeiRetailExtitemShopextitemQueryModel(object): def __init__(self): self._page_no = None self._page_size = None self._shop_id = None @property def page_no(self)...
25.774648
69
0.574863
import json from alipay.aop.api.constant.ParamConstants import * class KoubeiRetailExtitemShopextitemQueryModel(object): def __init__(self): self._page_no = None self._page_size = None self._shop_id = None @property def page_no(self): return self._page_no @page_no...
true
true
1c3c763ba462e94efda486c16f0267e00a7c6a54
1,915
py
Python
components/ui/button/index.py
wonknu/head_shot_adfab
7e85c483ef3d4c8044e24f0132c0a2b700108d29
[ "MIT" ]
null
null
null
components/ui/button/index.py
wonknu/head_shot_adfab
7e85c483ef3d4c8044e24f0132c0a2b700108d29
[ "MIT" ]
null
null
null
components/ui/button/index.py
wonknu/head_shot_adfab
7e85c483ef3d4c8044e24f0132c0a2b700108d29
[ "MIT" ]
null
null
null
# -*- coding: cp1252 -*- #/usr/bin/env python #Simon H. Larsen #Buttons #Project startet: d. 26. august 2012 import pygame from pygame.locals import * pygame.init() class Button: def create_button(self, surface, color, x, y, length, height, width, text, text_color): surface = self.draw_button(surf...
40.744681
106
0.557702
import pygame from pygame.locals import * pygame.init() class Button: def create_button(self, surface, color, x, y, length, height, width, text, text_color): surface = self.draw_button(surface, color, length, height, x, y, width) surface = self.write_text(surface, text, text_color, length...
true
true
1c3c76482a0cb9666264509e6b327cac252b25de
14,353
py
Python
infra_macros/macro_lib/convert/rust.py
martarozek/buckit
343cc5a5964c1d43902b6a77868652adaefa0caa
[ "BSD-3-Clause" ]
null
null
null
infra_macros/macro_lib/convert/rust.py
martarozek/buckit
343cc5a5964c1d43902b6a77868652adaefa0caa
[ "BSD-3-Clause" ]
null
null
null
infra_macros/macro_lib/convert/rust.py
martarozek/buckit
343cc5a5964c1d43902b6a77868652adaefa0caa
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python2 # Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. from...
32.181614
103
0.554031
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import collections import pipes import os.path macro_root = read_config('fbcode', 'macro_lib', '//macro_lib') include_defs("{}/convert/base.py".format(macro_roo...
true
true
1c3c76f7f6a1c8412b949d00c997a21efe94fb01
6,174
py
Python
amqpstorm/tests/unit/io/test_io.py
ZygusPatryk/amqpstorm
0f3ad84a529f12769d34638a88c38f3055cb05cd
[ "MIT" ]
140
2016-06-07T18:53:57.000Z
2022-03-23T01:50:15.000Z
amqpstorm/tests/unit/io/test_io.py
ZygusPatryk/amqpstorm
0f3ad84a529f12769d34638a88c38f3055cb05cd
[ "MIT" ]
85
2016-04-11T23:32:32.000Z
2022-03-19T07:21:21.000Z
amqpstorm/tests/unit/io/test_io.py
ZygusPatryk/amqpstorm
0f3ad84a529f12769d34638a88c38f3055cb05cd
[ "MIT" ]
38
2016-04-20T20:21:13.000Z
2022-03-23T05:31:58.000Z
import socket import ssl import mock import amqpstorm.io from amqpstorm.exception import AMQPConnectionError from amqpstorm.io import IO from amqpstorm.tests.utility import FakeConnection from amqpstorm.tests.utility import TestFramework class IOTests(TestFramework): def test_io_socket_close(self): con...
32.840426
75
0.645449
import socket import ssl import mock import amqpstorm.io from amqpstorm.exception import AMQPConnectionError from amqpstorm.io import IO from amqpstorm.tests.utility import FakeConnection from amqpstorm.tests.utility import TestFramework class IOTests(TestFramework): def test_io_socket_close(self): con...
true
true
1c3c7778c7ee126389e43d7099e098533df4a200
37,802
py
Python
python/pyspark/sql/session.py
zhouzach/spark
ad77b400da4089a2de74394e2b8aed813633025a
[ "BSD-2-Clause", "Apache-2.0", "CC0-1.0", "MIT", "MIT-0", "ECL-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
4
2019-12-02T00:44:54.000Z
2022-01-26T20:44:14.000Z
python/pyspark/sql/session.py
zhouzach/spark
ad77b400da4089a2de74394e2b8aed813633025a
[ "BSD-2-Clause", "Apache-2.0", "CC0-1.0", "MIT", "MIT-0", "ECL-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
23
2019-11-25T10:56:33.000Z
2022-02-16T01:07:16.000Z
python/pyspark/sql/session.py
zhouzach/spark
ad77b400da4089a2de74394e2b8aed813633025a
[ "BSD-2-Clause", "Apache-2.0", "CC0-1.0", "MIT", "MIT-0", "ECL-2.0", "BSD-3-Clause-No-Nuclear-License-2014", "BSD-3-Clause" ]
3
2022-03-09T05:11:47.000Z
2022-03-09T20:29:10.000Z
# # 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 us...
41.404162
100
0.598513
from __future__ import print_function import sys import warnings from functools import reduce from threading import RLock if sys.version >= '3': basestring = unicode = str xrange = range else: from itertools import izip as zip, imap as map from pyspark import since from pyspark.rdd import...
true
true
1c3c78ab9027a81c10ad54d82ba3a67d27d777c0
976
py
Python
setup.py
allanlei/tc-mongodb
28d09245fe81762cf4c1ba9d054f9a2a38735c6d
[ "MIT" ]
5
2016-08-31T04:15:31.000Z
2018-11-02T19:33:22.000Z
setup.py
allanlei/tc-mongodb
28d09245fe81762cf4c1ba9d054f9a2a38735c6d
[ "MIT" ]
3
2018-09-13T13:55:14.000Z
2022-01-23T20:52:02.000Z
setup.py
allanlei/tc-mongodb
28d09245fe81762cf4c1ba9d054f9a2a38735c6d
[ "MIT" ]
7
2016-08-31T04:15:42.000Z
2019-02-12T07:42:39.000Z
import os from setuptools import setup, find_packages try: import pypandoc long_description = pypandoc.convert('README.md', 'rst') except (IOError, ImportError): long_description = 'Thumbor mongodb storage adapters' def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() ...
25.025641
70
0.645492
import os from setuptools import setup, find_packages try: import pypandoc long_description = pypandoc.convert('README.md', 'rst') except (IOError, ImportError): long_description = 'Thumbor mongodb storage adapters' def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() ...
true
true