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
1c051afc13411020a3654ad65fd96dd86b2c6979
75,380
py
Python
baadalinstallation/baadal/modules/vm_helper.py
iitd-plos/baadal2.0
0496a8ddb5c0620f3448f018ba48b080b96cbe61
[ "Apache-2.0" ]
8
2017-01-30T17:40:18.000Z
2022-02-07T19:37:32.000Z
baadalinstallation/baadal/modules/vm_helper.py
iitd-plos/baadal2.0
0496a8ddb5c0620f3448f018ba48b080b96cbe61
[ "Apache-2.0" ]
null
null
null
baadalinstallation/baadal/modules/vm_helper.py
iitd-plos/baadal2.0
0496a8ddb5c0620f3448f018ba48b080b96cbe61
[ "Apache-2.0" ]
7
2016-11-08T13:38:10.000Z
2019-11-26T04:33:17.000Z
# -*- coding: utf-8 -*- ################################################################################### from gluon import current from helper import get_constant, execute_remote_cmd, config, get_datetime, \ log_exception, is_pingable, get_context_path from libvirt import * # @UnusedWildImport from log_handler ...
44.789067
237
0.655399
from gluon import current from helper import get_constant, execute_remote_cmd, config, get_datetime, \ log_exception, is_pingable, get_context_path from libvirt import * from log_handler import logger from nat_mapper import create_mapping, remove_mapping import math, shutil, libvirt, os, time, random import xml.et...
false
true
1c051b85bb0b9c983c28e2753be5b9bc1a03ed7f
23,830
py
Python
etta/php_wrappers.py
jennywwww/exofop-tess-api
fe3673e6cc379bea8a5ea4a053b9548c26d3775f
[ "MIT" ]
3
2021-08-29T23:07:48.000Z
2022-03-15T05:23:45.000Z
etta/php_wrappers.py
jennywwww/exofop-tess-api
fe3673e6cc379bea8a5ea4a053b9548c26d3775f
[ "MIT" ]
null
null
null
etta/php_wrappers.py
jennywwww/exofop-tess-api
fe3673e6cc379bea8a5ea4a053b9548c26d3775f
[ "MIT" ]
null
null
null
from .helpers import write_to_path, create_url, call_php_function def download_toi(toi=None, sort=None, output='pandas', path=None): """Accesses the full TOI table from https://exofop.ipac.caltech.edu/tess/view_toi.php Args: toi (str or int, optional): Access table information for a specific TOI. Defa...
56.603325
138
0.63055
from .helpers import write_to_path, create_url, call_php_function def download_toi(toi=None, sort=None, output='pandas', path=None): payload = {'output': output, 'sort': sort, 'toi': toi} return call_php_function('download_toi', payload, path, 1) def download_nearbytarget(tic, sort=None, output='pandas', path...
true
true
1c051bf850315ed553f935570f99b996d925dbfa
547
py
Python
spock/plugins/helpers/keepalive.py
micropsi-industries/spock
c337a9b5dfe1b141bab46b9e75301a8682510370
[ "MIT" ]
1
2015-01-28T17:01:05.000Z
2015-01-28T17:01:05.000Z
spock/plugins/helpers/keepalive.py
micropsi-industries/spock
c337a9b5dfe1b141bab46b9e75301a8682510370
[ "MIT" ]
null
null
null
spock/plugins/helpers/keepalive.py
micropsi-industries/spock
c337a9b5dfe1b141bab46b9e75301a8682510370
[ "MIT" ]
null
null
null
""" KeepalivePlugin is a pretty cool guy. Eh reflects keep alive packets and doesnt afraid of anything. """ from spock.mcp import mcdata, mcpacket class KeepalivePlugin: def __init__(self, ploader, settings): self.net = ploader.requires('Net') ploader.reg_event_handler( (mcdata.PLAY_STATE, mcdata.SERVER_TO_CL...
27.35
79
0.76234
from spock.mcp import mcdata, mcpacket class KeepalivePlugin: def __init__(self, ploader, settings): self.net = ploader.requires('Net') ploader.reg_event_handler( (mcdata.PLAY_STATE, mcdata.SERVER_TO_CLIENT, 0x00), self.handle_keep_alive ) def handle_keep_alive(self, name, packet): packet.new_ident(...
true
true
1c051c456cd217537315965d10cbbbb15d040e70
1,071
py
Python
bin/phase2/kill.py
wfxpanisa/pythonix
12fb90b9995b849b0c4c030f20b1aa1d85635599
[ "MIT" ]
72
2017-07-18T09:01:49.000Z
2021-09-02T03:50:51.000Z
bin/phase2/kill.py
wfzyx/pythonix
12fb90b9995b849b0c4c030f20b1aa1d85635599
[ "MIT" ]
2
2018-03-20T18:12:58.000Z
2018-06-15T13:20:58.000Z
bin/phase2/kill.py
wfzyx/pythonix
12fb90b9995b849b0c4c030f20b1aa1d85635599
[ "MIT" ]
12
2017-09-29T03:55:32.000Z
2021-04-13T01:47:57.000Z
#!/usr/pkg/bin/python2.7 # kill: send given signal to a specific pdi import sys import os import argparse import signal def killpid(pid, signame=False, signal='TERM', exitstatus=False): if signame: try: s = eval('signal.SIG'+signal.upper()) except AttributeError: print('Invalid...
22.3125
85
0.605042
import sys import os import argparse import signal def killpid(pid, signame=False, signal='TERM', exitstatus=False): if signame: try: s = eval('signal.SIG'+signal.upper()) except AttributeError: print('Invalid signal') return else: s = 15 if exitstatus...
true
true
1c051ca81a5248b0353c74a6c788755ce6a5e122
20,522
py
Python
corehq/pillows/mappings/domain_mapping.py
kkrampa/commcare-hq
d64d7cad98b240325ad669ccc7effb07721b4d44
[ "BSD-3-Clause" ]
1
2020-05-05T13:10:01.000Z
2020-05-05T13:10:01.000Z
corehq/pillows/mappings/domain_mapping.py
kkrampa/commcare-hq
d64d7cad98b240325ad669ccc7effb07721b4d44
[ "BSD-3-Clause" ]
1
2019-12-09T14:00:14.000Z
2019-12-09T14:00:14.000Z
corehq/pillows/mappings/domain_mapping.py
MaciejChoromanski/commcare-hq
fd7f65362d56d73b75a2c20d2afeabbc70876867
[ "BSD-3-Clause" ]
5
2015-11-30T13:12:45.000Z
2019-07-01T19:27:07.000Z
from __future__ import absolute_import from __future__ import unicode_literals from corehq.util.elastic import es_index from pillowtop.es_utils import ElasticsearchIndexInfo DOMAIN_INDEX = es_index("hqdomains_2016-08-08") DOMAIN_MAPPING = {'_meta': {'comment': '', 'created': None}, 'date_d...
76.289963
363
0.346896
from __future__ import absolute_import from __future__ import unicode_literals from corehq.util.elastic import es_index from pillowtop.es_utils import ElasticsearchIndexInfo DOMAIN_INDEX = es_index("hqdomains_2016-08-08") DOMAIN_MAPPING = {'_meta': {'comment': '', 'created': None}, 'date_d...
true
true
1c051d3753516f7312acfaab99a4b30158ed5b1b
8,529
py
Python
src/agoro_field_boundary_detector/field_detection/mask_rcnn/train.py
radix-ai/agoro-field-boundary-detector
9dd911df096ce865471ed0330174044f4172cc66
[ "MIT" ]
13
2021-07-19T07:25:26.000Z
2022-02-20T19:50:41.000Z
src/agoro_field_boundary_detector/field_detection/mask_rcnn/train.py
m0rp43us/agoro-field-boundary-detector
9dd911df096ce865471ed0330174044f4172cc66
[ "MIT" ]
2
2021-07-27T19:58:51.000Z
2021-09-19T04:01:26.000Z
src/agoro_field_boundary_detector/field_detection/mask_rcnn/train.py
m0rp43us/agoro-field-boundary-detector
9dd911df096ce865471ed0330174044f4172cc66
[ "MIT" ]
7
2021-08-20T13:16:34.000Z
2022-02-03T18:54:48.000Z
"""PyTorch Detection Training, code from https://github.com/pytorch/vision.""" import datetime import os import time from typing import Any import torch import torch.utils.data import torchvision import torchvision.models.detection import torchvision.models.detection.mask_rcnn from group_by_aspect_ratio import Grouped...
36.139831
113
0.663735
import datetime import os import time from typing import Any import torch import torch.utils.data import torchvision import torchvision.models.detection import torchvision.models.detection.mask_rcnn from group_by_aspect_ratio import GroupedBatchSampler, create_aspect_ratio_groups import src.agoro_field_boundary_detec...
true
true
1c051e0c55fbe3f232891ef1ecc26d26fcbe892f
1,152
py
Python
third_party/webrtc/src/chromium/src/build/android/devil/android/sdk/aapt.py
bopopescu/webrtc-streaming-node
727a441204344ff596401b0253caac372b714d91
[ "MIT" ]
8
2016-02-08T11:59:31.000Z
2020-05-31T15:19:54.000Z
third_party/webrtc/src/chromium/src/build/android/devil/android/sdk/aapt.py
bopopescu/webrtc-streaming-node
727a441204344ff596401b0253caac372b714d91
[ "MIT" ]
1
2016-01-29T00:54:49.000Z
2016-01-29T00:54:49.000Z
third_party/webrtc/src/chromium/src/build/android/devil/android/sdk/aapt.py
bopopescu/webrtc-streaming-node
727a441204344ff596401b0253caac372b714d91
[ "MIT" ]
7
2016-02-09T09:28:14.000Z
2020-07-25T19:03:36.000Z
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """This module wraps the Android Asset Packaging Tool.""" import os from devil.utils import cmd_helper from pylib import constants _AAPT_PATH = os.path.jo...
27.428571
75
0.688368
import os from devil.utils import cmd_helper from pylib import constants _AAPT_PATH = os.path.join(constants.ANDROID_SDK_TOOLS, 'aapt') def _RunAaptCmd(args): cmd = [_AAPT_PATH] + args status, output = cmd_helper.GetCmdStatusAndOutput(cmd) if status != 0: raise Exception('Failed running aapt command: "%s...
true
true
1c051f21c9280caa85d124d965a8776a5ab1bd0a
1,314
py
Python
bot_config/cfg_func.py
jmeel14/yt-databot-discord
82c54acce87546039853307389b711c3f36284aa
[ "Apache-2.0" ]
null
null
null
bot_config/cfg_func.py
jmeel14/yt-databot-discord
82c54acce87546039853307389b711c3f36284aa
[ "Apache-2.0" ]
null
null
null
bot_config/cfg_func.py
jmeel14/yt-databot-discord
82c54acce87546039853307389b711c3f36284aa
[ "Apache-2.0" ]
null
null
null
from re import search as re_s from re import escape as re_esc from re import DOTALL as re_d def check_trigger(msg_obj, self_id, self_prefix): """Checks the message for a trigger, whether it's a mention or self ID.""" mention_name_string = re_esc("<@") + self_id + re_esc(">") + "\s" mention_name_detect = r...
35.513514
119
0.674277
from re import search as re_s from re import escape as re_esc from re import DOTALL as re_d def check_trigger(msg_obj, self_id, self_prefix): mention_name_string = re_esc("<@") + self_id + re_esc(">") + "\s" mention_name_detect = re_s("^" + mention_name_string, msg_obj.content) prefix_string = self_prefi...
true
true
1c051f584cf0c295774b5b324bfcea8e891577b2
7,303
py
Python
elasticwatcher/config.py
leonzhan/elasticwatcher
f6c2e9cb82ed607f4125ee2a0f8ad47f71167bba
[ "Apache-2.0" ]
1
2016-12-05T16:19:44.000Z
2016-12-05T16:19:44.000Z
elasticwatcher/config.py
leonzhan/elasticwatcher
f6c2e9cb82ed607f4125ee2a0f8ad47f71167bba
[ "Apache-2.0" ]
1
2021-06-01T22:25:06.000Z
2021-06-01T22:25:06.000Z
elasticwatcher/config.py
leonzhan/elasticwatcher
f6c2e9cb82ed607f4125ee2a0f8ad47f71167bba
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import copy import datetime import hashlib import json import logging import os import alerts import rule_types from util import EAException from util import elastalert_logger from util import ts_to_dt from util import dt_to_ts # Used to map names of alert...
34.286385
121
0.656853
import codecs import copy import datetime import hashlib import json import logging import os import alerts import rule_types from util import EAException from util import elastalert_logger from util import ts_to_dt from util import dt_to_ts alerts_mapping = { 'pagerduty': alerts.PagerDutyAlerter } rules_mappi...
false
true
1c05209a2c525ac016c64b711840973cd7e91fa4
10,028
py
Python
tfx/orchestration/portable/inputs_utils.py
ssoudan/tfx
13979ced62b50292a5dea7be2f15205fe8469400
[ "Apache-2.0" ]
null
null
null
tfx/orchestration/portable/inputs_utils.py
ssoudan/tfx
13979ced62b50292a5dea7be2f15205fe8469400
[ "Apache-2.0" ]
null
null
null
tfx/orchestration/portable/inputs_utils.py
ssoudan/tfx
13979ced62b50292a5dea7be2f15205fe8469400
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 Google LLC. 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 required by applicable law or a...
35.814286
80
0.746011
from typing import Dict, Iterable, List, Optional, Mapping, Sequence, Union from absl import logging from tfx import types from tfx.orchestration import data_types_utils from tfx.orchestration import metadata from tfx.orchestration.portable.input_resolution import exceptions from tfx.orchestration.portable.input_resol...
true
true
1c052320fa71669fa51f38ca0eed53f9c4b34b78
79,822
py
Python
ckan/plugins/interfaces.py
RabiaSajjad/ckan
ada55a5b32916f07ce04a6e1b51efeca848f68da
[ "BSD-3-Clause" ]
null
null
null
ckan/plugins/interfaces.py
RabiaSajjad/ckan
ada55a5b32916f07ce04a6e1b51efeca848f68da
[ "BSD-3-Clause" ]
null
null
null
ckan/plugins/interfaces.py
RabiaSajjad/ckan
ada55a5b32916f07ce04a6e1b51efeca848f68da
[ "BSD-3-Clause" ]
null
null
null
# encoding: utf-8 u'''A collection of interfaces that CKAN plugins can implement to customize and extend CKAN. ''' from __future__ import annotations import warnings from typing import (Any, Callable, Iterable, Mapping, Optional, Sequence, TYPE_CHECKING, Type, Union) from pyutilib.component.core...
36.315742
79
0.635677
from __future__ import annotations import warnings from typing import (Any, Callable, Iterable, Mapping, Optional, Sequence, TYPE_CHECKING, Type, Union) from pyutilib.component.core import Interface as _pca_Interface from flask.blueprints import Blueprint from flask.wrappers import Response fro...
true
true
1c05233071f4e52b94570da02c576b86dedbd5ff
3,128
py
Python
ignite/contrib/metrics/regression/fractional_absolute_error.py
Eunjnnn/ignite
743089705b2b252aa5e2a0f310da3a8724d6711e
[ "BSD-3-Clause" ]
4,119
2017-11-23T18:10:37.000Z
2022-03-31T05:31:27.000Z
ignite/contrib/metrics/regression/fractional_absolute_error.py
Eunjnnn/ignite
743089705b2b252aa5e2a0f310da3a8724d6711e
[ "BSD-3-Clause" ]
1,838
2017-11-24T11:19:25.000Z
2022-03-31T09:08:18.000Z
ignite/contrib/metrics/regression/fractional_absolute_error.py
Eunjnnn/ignite
743089705b2b252aa5e2a0f310da3a8724d6711e
[ "BSD-3-Clause" ]
691
2017-11-24T10:57:33.000Z
2022-03-29T02:19:44.000Z
from typing import Tuple import torch from ignite.contrib.metrics.regression._base import _BaseRegression from ignite.exceptions import NotComputableError from ignite.metrics.metric import reinit__is_reduced, sync_all_reduce class FractionalAbsoluteError(_BaseRegression): r"""Calculates the Fractional Absolute ...
40.623377
111
0.628517
from typing import Tuple import torch from ignite.contrib.metrics.regression._base import _BaseRegression from ignite.exceptions import NotComputableError from ignite.metrics.metric import reinit__is_reduced, sync_all_reduce class FractionalAbsoluteError(_BaseRegression): @reinit__is_reduced def reset(self...
true
true
1c052353e8c86d645142e2877d28657f53323749
366
py
Python
XiuxiuService/AliSDK/top/api/rest/AlibabaAliqinFcIotQrycardRequest.py
nightHearter/XiuxiuService
281c2d5eef85936edcd0d9ec97c8d165078f444c
[ "MIT" ]
null
null
null
XiuxiuService/AliSDK/top/api/rest/AlibabaAliqinFcIotQrycardRequest.py
nightHearter/XiuxiuService
281c2d5eef85936edcd0d9ec97c8d165078f444c
[ "MIT" ]
null
null
null
XiuxiuService/AliSDK/top/api/rest/AlibabaAliqinFcIotQrycardRequest.py
nightHearter/XiuxiuService
281c2d5eef85936edcd0d9ec97c8d165078f444c
[ "MIT" ]
null
null
null
''' Created by auto_sdk on 2017.03.14 ''' from top.api.base import RestApi class AlibabaAliqinFcIotQrycardRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.bill_real = None self.bill_source = None self.iccid = None def getapiname(self...
26.142857
56
0.724044
from top.api.base import RestApi class AlibabaAliqinFcIotQrycardRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.bill_real = None self.bill_source = None self.iccid = None def getapiname(self): return 'alibaba.aliqin.fc.iot.qrycard' ...
true
true
1c052354b8afcc5fd8a53b783cc5c676588cf48c
14,492
py
Python
tensorflow/contrib/signal/python/kernel_tests/shape_ops_test.py
M155K4R4/Tensorflow
e5e03ef3148303b3dfed89a1492dedf92b45be25
[ "Apache-2.0" ]
522
2016-06-08T02:15:50.000Z
2022-03-02T05:30:36.000Z
tensorflow/contrib/signal/python/kernel_tests/shape_ops_test.py
M155K4R4/Tensorflow
e5e03ef3148303b3dfed89a1492dedf92b45be25
[ "Apache-2.0" ]
48
2016-07-26T00:11:55.000Z
2022-02-23T13:36:33.000Z
tensorflow/contrib/signal/python/kernel_tests/shape_ops_test.py
M155K4R4/Tensorflow
e5e03ef3148303b3dfed89a1492dedf92b45be25
[ "Apache-2.0" ]
108
2016-06-16T15:34:05.000Z
2022-03-12T13:23:11.000Z
# Copyright 2015 The TensorFlow Authors. 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 required by applica...
40.822535
80
0.57963
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.contrib.signal.python.kernel_tests import test_util from tensorflow.contrib.signal.python.ops import shape_ops from tensorflow.python.framework import constant_op from tenso...
true
true
1c052426961dcd6ab9d451f1e3f10c6b12c2234e
3,512
py
Python
lib/ClusterConfigGrammar/ClusterConfigLoader.py
RoryAndrews/Python-Parallel-DB
64280bc4e149013061a181e0fa1974c98e303d9e
[ "MIT" ]
null
null
null
lib/ClusterConfigGrammar/ClusterConfigLoader.py
RoryAndrews/Python-Parallel-DB
64280bc4e149013061a181e0fa1974c98e303d9e
[ "MIT" ]
null
null
null
lib/ClusterConfigGrammar/ClusterConfigLoader.py
RoryAndrews/Python-Parallel-DB
64280bc4e149013061a181e0fa1974c98e303d9e
[ "MIT" ]
null
null
null
import sys from antlr4 import * from antlr4.InputStream import InputStream if __name__ is not None and "." in __name__: from .ClusterConfigParser import ClusterConfigParser from .ClusterConfigListener import ClusterConfigListener else: from ClusterConfigParser import ClusterConfigParser from ClusterCon...
39.022222
110
0.660877
import sys from antlr4 import * from antlr4.InputStream import InputStream if __name__ is not None and "." in __name__: from .ClusterConfigParser import ClusterConfigParser from .ClusterConfigListener import ClusterConfigListener else: from ClusterConfigParser import ClusterConfigParser from ClusterCon...
true
true
1c0524eca75b59aaa31a68f1d5f76893ad0792cf
1,876
py
Python
XDSM/pyXDSM/examples/mat_eqn.py
skilkis/MDO
255e460d8ad96b6c128c0cd34789fa78fec5e1ff
[ "Apache-2.0" ]
4
2019-01-08T13:53:30.000Z
2021-11-10T15:01:24.000Z
XDSM/pyXDSM/examples/mat_eqn.py
skilkis/MDO
255e460d8ad96b6c128c0cd34789fa78fec5e1ff
[ "Apache-2.0" ]
null
null
null
XDSM/pyXDSM/examples/mat_eqn.py
skilkis/MDO
255e460d8ad96b6c128c0cd34789fa78fec5e1ff
[ "Apache-2.0" ]
1
2020-08-30T08:52:25.000Z
2020-08-30T08:52:25.000Z
from pyxdsm.matrix_eqn import MatrixEquation ################################ # define the system ################################ lin_system = MatrixEquation() lin_system.add_variable(1, size=1, text="a") lin_system.add_variable(2, size=1, text="b") lin_system.add_variable(3, size=1, text="c") lin_syst...
28.861538
75
0.658849
from pyxdsm.matrix_eqn import MatrixEquation lin_system = MatrixEquation() lin_system.add_variable(1, size=1, text="a") lin_system.add_variable(2, size=1, text="b") lin_system.add_variable(3, size=1, text="c") lin_system.add_variable(4, size=2, ) lin_system.add_variable(5, size=2, ) lin_system.add_vari...
true
true
1c0525edbd6d9f5dfc5806e4bcf00760215ee826
2,196
py
Python
test/test_bootstrap.py
calebho/gameanalysis
280726a8aa125850b827a1e10b1203e91f515461
[ "Apache-2.0" ]
null
null
null
test/test_bootstrap.py
calebho/gameanalysis
280726a8aa125850b827a1e10b1203e91f515461
[ "Apache-2.0" ]
null
null
null
test/test_bootstrap.py
calebho/gameanalysis
280726a8aa125850b827a1e10b1203e91f515461
[ "Apache-2.0" ]
null
null
null
"""Test bootstrap""" import numpy as np import pytest from gameanalysis import bootstrap from gameanalysis import gamegen from test import utils # pylint: disable=wrong-import-order @pytest.mark.parametrize('num_mixes', [5]) @pytest.mark.parametrize('num_boots', [200]) @pytest.mark.parametrize('base', utils.basic_ga...
37.862069
79
0.715847
import numpy as np import pytest from gameanalysis import bootstrap from gameanalysis import gamegen from test import utils @pytest.mark.parametrize('num_mixes', [5]) @pytest.mark.parametrize('num_boots', [200]) @pytest.mark.parametrize('base', utils.basic_games()) def test_mixture_welfare(base, num_mixes, num_boots...
true
true
1c0527ba982dfb33389fd5ccdd9b2a85fd4003bb
14,039
py
Python
ci/tests/test_ephys_pipeline.py
berkgercek/iblscripts
c11988ff5659bcdd7cb9bf14e6589f0f7f946938
[ "MIT" ]
null
null
null
ci/tests/test_ephys_pipeline.py
berkgercek/iblscripts
c11988ff5659bcdd7cb9bf14e6589f0f7f946938
[ "MIT" ]
null
null
null
ci/tests/test_ephys_pipeline.py
berkgercek/iblscripts
c11988ff5659bcdd7cb9bf14e6589f0f7f946938
[ "MIT" ]
null
null
null
import logging import shutil from pathlib import Path import numpy as np import tempfile import alf.io from ibllib.pipes import local_server from oneibl.one import ONE from ci.tests import base CACHE_DIR = tempfile.TemporaryDirectory() _logger = logging.getLogger('ibllib') class TestEphysPipeline(base.IntegrationT...
52.189591
103
0.535295
import logging import shutil from pathlib import Path import numpy as np import tempfile import alf.io from ibllib.pipes import local_server from oneibl.one import ONE from ci.tests import base CACHE_DIR = tempfile.TemporaryDirectory() _logger = logging.getLogger('ibllib') class TestEphysPipeline(base.IntegrationT...
true
true
1c05292514f8b579cebb07e9600d8851779465fd
2,156
py
Python
openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_encrypt/Opengauss_Function_Tools_gs_encrypt_Case0099.py
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_encrypt/Opengauss_Function_Tools_gs_encrypt_Case0099.py
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
openGaussBase/testcase/TOOLS/SERVER_TOOLS/gs_encrypt/Opengauss_Function_Tools_gs_encrypt_Case0099.py
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
""" Copyright (c) 2022 Huawei Technologies Co.,Ltd. openGauss is licensed under Mulan PSL v2. You can use this software according to the terms and conditions of the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2 THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W...
33.6875
84
0.623377
import os import unittest from yat.test import Node from yat.test import macro from testcase.utils.Common import Common from testcase.utils.Logger import Logger class GsEncrypt60(unittest.TestCase): def setUp(self): self.logger = Logger() self.logger.info(f'-----{os.path.basename(__file__)} start...
true
true
1c0529ad802e74e460e2968ce00df93174e0394d
1,807
py
Python
pysrc/sub_module/align.py
wanjun-group-seu/AQUARIUM
a65fe93b6ae85ec52f535d0651b6956c6a4b0d3f
[ "MIT" ]
null
null
null
pysrc/sub_module/align.py
wanjun-group-seu/AQUARIUM
a65fe93b6ae85ec52f535d0651b6956c6a4b0d3f
[ "MIT" ]
null
null
null
pysrc/sub_module/align.py
wanjun-group-seu/AQUARIUM
a65fe93b6ae85ec52f535d0651b6956c6a4b0d3f
[ "MIT" ]
null
null
null
# !/usr/bin/env python # -*- coding:utf-8 -*- # author : zerodel # Readme: # import pysrc.body.cli_opts import pysrc.body.config import pysrc.wrapper.bwa import pysrc.wrapper.star __doc__ = ''' ''' __author__ = 'zerodel' available_tools = { "star": pysrc.wrapper.star, "bwa": pysrc.wrapper.bwa } _OPT_KEY_NAM...
29.145161
91
0.703929
import pysrc.body.cli_opts import pysrc.body.config import pysrc.wrapper.bwa import pysrc.wrapper.star __doc__ = ''' ''' __author__ = 'zerodel' available_tools = { "star": pysrc.wrapper.star, "bwa": pysrc.wrapper.bwa } _OPT_KEY_NAME_ALIGNER = "mapper" def work(whole_config_content=None, aligner_name=None,...
true
true
1c0529c3c1ae5387c94fafe063a0943c9d106244
21,689
py
Python
source_code/pacmap/pacmap.py
kemaleren/PaCMAP
a171106bbafeff62cb27df898c8777ae2f67dbfe
[ "Apache-2.0" ]
null
null
null
source_code/pacmap/pacmap.py
kemaleren/PaCMAP
a171106bbafeff62cb27df898c8777ae2f67dbfe
[ "Apache-2.0" ]
null
null
null
source_code/pacmap/pacmap.py
kemaleren/PaCMAP
a171106bbafeff62cb27df898c8777ae2f67dbfe
[ "Apache-2.0" ]
null
null
null
import numpy as np from sklearn.base import BaseEstimator import numba from annoy import AnnoyIndex from sklearn.decomposition import TruncatedSVD from sklearn.decomposition import PCA from sklearn import preprocessing import time import math import datetime import warnings global _RANDOM_STATE _RANDOM_STATE = None ...
33.265337
113
0.538798
import numpy as np from sklearn.base import BaseEstimator import numba from annoy import AnnoyIndex from sklearn.decomposition import TruncatedSVD from sklearn.decomposition import PCA from sklearn import preprocessing import time import math import datetime import warnings global _RANDOM_STATE _RANDOM_STATE = None ...
true
true
1c052a7696c31b0ccd8bf594b831b7449319cb91
3,246
py
Python
lumicks/pylake/kymotracker/tests/test_io.py
lumicks/pylake
b5875d156d6416793a371198f3f2590fca2be4cd
[ "Apache-2.0" ]
8
2019-02-18T07:56:39.000Z
2022-03-19T01:14:48.000Z
lumicks/pylake/kymotracker/tests/test_io.py
lumicks/pylake
b5875d156d6416793a371198f3f2590fca2be4cd
[ "Apache-2.0" ]
42
2018-11-30T14:40:35.000Z
2022-03-29T11:43:45.000Z
lumicks/pylake/kymotracker/tests/test_io.py
lumicks/pylake
b5875d156d6416793a371198f3f2590fca2be4cd
[ "Apache-2.0" ]
4
2019-01-09T13:45:53.000Z
2021-07-06T14:06:52.000Z
from lumicks.pylake.kymotracker.detail.calibrated_images import CalibratedKymographChannel from lumicks.pylake.kymotracker.kymoline import KymoLine, KymoLineGroup, import_kymolinegroup_from_csv import numpy as np import pytest from lumicks.pylake.tests.data.mock_confocal import generate_kymo @pytest.fixture(scope="se...
39.108434
118
0.629698
from lumicks.pylake.kymotracker.detail.calibrated_images import CalibratedKymographChannel from lumicks.pylake.kymotracker.kymoline import KymoLine, KymoLineGroup, import_kymolinegroup_from_csv import numpy as np import pytest from lumicks.pylake.tests.data.mock_confocal import generate_kymo @pytest.fixture(scope="se...
true
true
1c052adae68ffc5068c801e735a54d408a58869c
1,565
py
Python
reproduce/evaluate_EMF_model.py
lrgr/xsmf
f7a144812a2446a09b08a6a4b3abf624205b28e0
[ "MIT" ]
2
2020-08-05T17:06:31.000Z
2022-03-30T12:35:09.000Z
reproduce/evaluate_EMF_model.py
lrgr/EMF
f7a144812a2446a09b08a6a4b3abf624205b28e0
[ "MIT" ]
null
null
null
reproduce/evaluate_EMF_model.py
lrgr/EMF
f7a144812a2446a09b08a6a4b3abf624205b28e0
[ "MIT" ]
null
null
null
import argparse import sys import os sys.path.append(os.path.join("..", "src")) import cloudpickle as cpkl from benchmark_mf import evaluate_preds from utils import summarize_results, log_results from i_o import setup_logging, get_logger def parse_args(): parser = argparse.ArgumentParser() parser.add_argume...
30.096154
101
0.694569
import argparse import sys import os sys.path.append(os.path.join("..", "src")) import cloudpickle as cpkl from benchmark_mf import evaluate_preds from utils import summarize_results, log_results from i_o import setup_logging, get_logger def parse_args(): parser = argparse.ArgumentParser() parser.add_argume...
true
true
1c052ade5de4871fd415109a3ec39ffa0d617ab6
25,438
py
Python
eqbtest/functional/test_runner.py
macterra/equibit-core
e02df3e4c2d1276ed960113b75456a6c817cc44c
[ "MIT" ]
null
null
null
eqbtest/functional/test_runner.py
macterra/equibit-core
e02df3e4c2d1276ed960113b75456a6c817cc44c
[ "MIT" ]
null
null
null
eqbtest/functional/test_runner.py
macterra/equibit-core
e02df3e4c2d1276ed960113b75456a6c817cc44c
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # Copyright (c) 2014-2017 The Bitcoin Core developers # Copyright (c) 2018 Equibit Group AG # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Run regression test suite. This module calls down into individua...
41.295455
195
0.628233
import argparse from collections import deque import configparser import datetime import os import time import shutil import signal import sys import subprocess import tempfile import re import logging BOLD, BLUE, RED, GREY = ("", ""), ("", ""), ("", ""), ("", "") try: "\u2713".encode("utf_8").decode(sys.stdo...
true
true
1c052b6488096edf6463b6d8492a5087af7b91c6
1,355
py
Python
mopidy_slack/command/start.py
ablanchard/mopidy-slack
e5c445144899bc4e4d0e2e25635af9850798f026
[ "Apache-2.0" ]
null
null
null
mopidy_slack/command/start.py
ablanchard/mopidy-slack
e5c445144899bc4e4d0e2e25635af9850798f026
[ "Apache-2.0" ]
null
null
null
mopidy_slack/command/start.py
ablanchard/mopidy-slack
e5c445144899bc4e4d0e2e25635af9850798f026
[ "Apache-2.0" ]
null
null
null
from . import listener import random class StartListener(listener.CommandListener): def __init__(self,core, channel_holder): self.core = core self.started = False self.channel_holder = channel_holder def command(self): return 'start' def action(self, msg, user, channel): ...
32.261905
88
0.634686
from . import listener import random class StartListener(listener.CommandListener): def __init__(self,core, channel_holder): self.core = core self.started = False self.channel_holder = channel_holder def command(self): return 'start' def action(self, msg, user, channel): ...
true
true
1c052bce1aae9389e9376a990afbdfa20178c1f9
142,053
py
Python
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
holazzer/transformers
53191d75ecca21c028077b3227f9ac47379e4690
[ "Apache-2.0" ]
28
2021-09-15T01:25:00.000Z
2022-03-01T20:21:28.000Z
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
holazzer/transformers
53191d75ecca21c028077b3227f9ac47379e4690
[ "Apache-2.0" ]
1
2021-08-09T01:51:17.000Z
2021-08-09T01:51:17.000Z
src/transformers/models/bigbird_pegasus/modeling_bigbird_pegasus.py
holazzer/transformers
53191d75ecca21c028077b3227f9ac47379e4690
[ "Apache-2.0" ]
1
2021-12-21T12:23:30.000Z
2021-12-21T12:23:30.000Z
# coding=utf-8 # Copyright 2021 Google Research 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/LICENSE-...
46.851253
201
0.643387
import copy import math import random from typing import Optional, Tuple import numpy as np import torch from torch import nn from torch.nn import CrossEntropyLoss, MSELoss from ...activations import ACT2FN from ...file_utils import ( add_code_sample_docstrings, add_end_docstrings, add_start_docstrings,...
true
true
1c052c2621e34cf82acb3ca0e4c55598e075b2ed
2,284
py
Python
ejercicios_python/Clase06/tabla_informe.py
hcgalvan/UNSAM-Python-programming
c4b3f5ae0702dc03ea6010cb8051c7eec6aef42f
[ "MIT" ]
null
null
null
ejercicios_python/Clase06/tabla_informe.py
hcgalvan/UNSAM-Python-programming
c4b3f5ae0702dc03ea6010cb8051c7eec6aef42f
[ "MIT" ]
null
null
null
ejercicios_python/Clase06/tabla_informe.py
hcgalvan/UNSAM-Python-programming
c4b3f5ae0702dc03ea6010cb8051c7eec6aef42f
[ "MIT" ]
null
null
null
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Sep 7 12:34:08 2021 @author: mcerdeiro """ # tabla_informe.py import csv def leer_camion(nombre_archivo): '''Computa el precio total del camion (cajones * precio) de un archivo''' camion = [] with open(nombre_archivo, 'rt') as f: ...
30.864865
77
0.549475
import csv def leer_camion(nombre_archivo): camion = [] with open(nombre_archivo, 'rt') as f: filas = csv.reader(f) encabezados = next(filas) for n_fila, fila in enumerate(filas, start = 1): record = dict(zip(encabezados, fila)) try: rec...
true
true
1c052d017408739454c387579657e73c32244c7f
7,004
py
Python
run/unsup/__init__.py
BenevolentAI/RELVM
468da9eb78714932612e54454bb06c4beac1bd1d
[ "MIT" ]
13
2020-11-24T11:55:34.000Z
2022-03-29T02:14:15.000Z
run/unsup/__init__.py
BenevolentAI/RELVM
468da9eb78714932612e54454bb06c4beac1bd1d
[ "MIT" ]
3
2021-01-07T05:13:07.000Z
2021-03-04T02:12:30.000Z
run/unsup/__init__.py
BenevolentAI/RELVM
468da9eb78714932612e54454bb06c4beac1bd1d
[ "MIT" ]
3
2021-03-25T07:33:08.000Z
2022-03-29T02:14:17.000Z
import os import time import numpy as np import tensorflow as tf class Run(object): """ This Run class handles initialising the trainer, loading data, creating the Tensorflow dataset and model training for the unsupervised representation model. Parameters ---------- data_dir : str The...
36.479167
117
0.594803
import os import time import numpy as np import tensorflow as tf class Run(object): def __init__(self, data_dir, vocab, entity_types, num_data, max_len, trainer, trainer_kwargs, out_dir, pre_trained=False, pre_trained_dir=None): self.vocab = vocab self.entity_types = entity_type...
true
true
1c052d97f8f88663de328fe3d93fca23154ce314
849
py
Python
integration/test_html_output.py
jleverenz/hurl
b81ca8ab7e0e409ec0c074fd8e118721ff4d3fb3
[ "Apache-2.0" ]
null
null
null
integration/test_html_output.py
jleverenz/hurl
b81ca8ab7e0e409ec0c074fd8e118721ff4d3fb3
[ "Apache-2.0" ]
null
null
null
integration/test_html_output.py
jleverenz/hurl
b81ca8ab7e0e409ec0c074fd8e118721ff4d3fb3
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python3 # Extract hurl file from html output import sys from bs4 import BeautifulSoup import os import codecs def test(html_file): print(html_file) actual = extract_hurl_content(html_file) hurl_file = os.path.splitext(html_file)[0] + ".hurl" if not os.path.isfile(hurl_file): re...
22.342105
60
0.644287
import sys from bs4 import BeautifulSoup import os import codecs def test(html_file): print(html_file) actual = extract_hurl_content(html_file) hurl_file = os.path.splitext(html_file)[0] + ".hurl" if not os.path.isfile(hurl_file): return expected = codecs.open( hurl_file, encoding...
true
true
1c052da51cb9df9793433aabf91208609c1086e7
4,066
py
Python
lox/Expr.py
tonisidneimc/PyLox
b4fb236edccfe5f6c7fa3e48d7adcbc99363be8a
[ "MIT" ]
null
null
null
lox/Expr.py
tonisidneimc/PyLox
b4fb236edccfe5f6c7fa3e48d7adcbc99363be8a
[ "MIT" ]
null
null
null
lox/Expr.py
tonisidneimc/PyLox
b4fb236edccfe5f6c7fa3e48d7adcbc99363be8a
[ "MIT" ]
null
null
null
from .Token import * class Expr(object) : pass class Grouping (Expr) : #grouping -> "(" expression ")" def __init__(self, expression : Expr) : self.expression = expression def __str__(self) : return "(" + str(self.expression) + ")" class Literal (Expr) : #literal -> NUMB...
29.042857
96
0.563945
from .Token import * class Expr(object) : pass class Grouping (Expr) : def __init__(self, expression : Expr) : self.expression = expression def __str__(self) : return "(" + str(self.expression) + ")" class Literal (Expr) : def __init__(self, value : object) : ...
true
true
1c052e53fe4bf938df16275e781723ada684b53b
28,371
py
Python
monai/transforms/utils_create_transform_ims.py
dyollb/MONAI
9084c452c48095c82c71d4391b3684006e5a3c56
[ "Apache-2.0" ]
null
null
null
monai/transforms/utils_create_transform_ims.py
dyollb/MONAI
9084c452c48095c82c71d4391b3684006e5a3c56
[ "Apache-2.0" ]
null
null
null
monai/transforms/utils_create_transform_ims.py
dyollb/MONAI
9084c452c48095c82c71d4391b3684006e5a3c56
[ "Apache-2.0" ]
null
null
null
# Copyright 2020 - 2021 MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in wri...
41.783505
120
0.68637
import os import pathlib import tempfile import textwrap from copy import deepcopy from glob import glob from typing import TYPE_CHECKING, Callable import numpy as np import torch from monai.apps import download_and_extract from monai.transforms import ( AddChanneld, Affine, Affined, AsDiscrete, ...
true
true
1c052e7d7bbd3c48a39ef3f3c8359b01e164962a
294
py
Python
invenio_rdm_records/records/jsonschemas/__init__.py
kprzerwa/invenio-rdm-records
d5919b5f1b5f453074fcb2b63929a60bfcb240ed
[ "MIT" ]
null
null
null
invenio_rdm_records/records/jsonschemas/__init__.py
kprzerwa/invenio-rdm-records
d5919b5f1b5f453074fcb2b63929a60bfcb240ed
[ "MIT" ]
null
null
null
invenio_rdm_records/records/jsonschemas/__init__.py
kprzerwa/invenio-rdm-records
d5919b5f1b5f453074fcb2b63929a60bfcb240ed
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- # # Copyright (C) 2019 CERN. # Copyright (C) 2019 Northwestern University. # # Invenio-RDM-Records is free software; you can redistribute it and/or modify # it under the terms of the MIT License; see LICENSE file for more details. """RDM DataCite based JSON Schema."""
29.4
77
0.714286
true
true
1c052f23210b487fd080c24bd7e3808e6fb33165
777
py
Python
application/models/user.py
leonmak/React-Redux-Flask
09191f5c39bceee10e92e01287ad99cb0fc89ea6
[ "MIT" ]
2
2017-07-08T04:02:28.000Z
2017-07-10T05:41:09.000Z
application/models/user.py
leonmak/React-Redux-Flask
09191f5c39bceee10e92e01287ad99cb0fc89ea6
[ "MIT" ]
null
null
null
application/models/user.py
leonmak/React-Redux-Flask
09191f5c39bceee10e92e01287ad99cb0fc89ea6
[ "MIT" ]
1
2021-01-13T11:28:32.000Z
2021-01-13T11:28:32.000Z
from index import db from werkzeug.security import generate_password_hash, check_password_hash class User(db.Model): id = db.Column(db.Integer(), primary_key=True) email = db.Column(db.String(255), unique=True) password = db.Column(db.String(255)) def __init__(self, email, password): self.emai...
31.08
73
0.685972
from index import db from werkzeug.security import generate_password_hash, check_password_hash class User(db.Model): id = db.Column(db.Integer(), primary_key=True) email = db.Column(db.String(255), unique=True) password = db.Column(db.String(255)) def __init__(self, email, password): self.emai...
true
true
1c052f36c5bfd6de5c13b51656192fbfc9e19e42
9,015
py
Python
docusign_esign/models/integrated_user_info_list.py
hunk/docusign-python-client
a643c42c1236715e74eef6fc279a1b29da1b5455
[ "MIT" ]
null
null
null
docusign_esign/models/integrated_user_info_list.py
hunk/docusign-python-client
a643c42c1236715e74eef6fc279a1b29da1b5455
[ "MIT" ]
null
null
null
docusign_esign/models/integrated_user_info_list.py
hunk/docusign-python-client
a643c42c1236715e74eef6fc279a1b29da1b5455
[ "MIT" ]
null
null
null
# coding: utf-8 """ DocuSign REST API The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. OpenAPI spec version: v2.1 Contact: devcenter@docusign.com Generated by: https://github.com/swagger-api/swagger-codegen.git """ from p...
30.353535
179
0.614531
from pprint import pformat from six import iteritems import re class IntegratedUserInfoList(object): def __init__(self, all_users_selected=None, end_position=None, next_uri=None, previous_uri=None, result_set_size=None, start_position=None, total_set_size=None, users=None): self.swagger_types = { ...
true
true
1c053042155d010d7a76aa6283b5cc424deec4c2
2,500
py
Python
game/player.py
Zedwill96/Pokemon-py
f7657ddfaa3ef041124245aa2d0e2b73c1fb1032
[ "MIT" ]
null
null
null
game/player.py
Zedwill96/Pokemon-py
f7657ddfaa3ef041124245aa2d0e2b73c1fb1032
[ "MIT" ]
null
null
null
game/player.py
Zedwill96/Pokemon-py
f7657ddfaa3ef041124245aa2d0e2b73c1fb1032
[ "MIT" ]
1
2021-04-27T14:05:57.000Z
2021-04-27T14:05:57.000Z
import asyncio from typing import List from readchar import * from api import pokeapi from config.config import TEXT from game.pokemon import Pokemon class Player: """Holds current information about the player""" team: List[Pokemon] = [] def __init__(self): """Fills the player's team with a rand...
33.333333
97
0.5504
import asyncio from typing import List from readchar import * from api import pokeapi from config.config import TEXT from game.pokemon import Pokemon class Player: team: List[Pokemon] = [] def __init__(self): self.add_to_team(asyncio.run(pokeapi.get_random_pokemon_from_api())) def add_t...
true
true
1c0530de193e3e8a886166a0ffe1431ef8cbbf82
396
py
Python
safe_relay_service/tokens/migrations/0011_auto_20190225_1646.py
gnosis/safe-relay-service
e4db2f9b85aab612653785766d4c1f4d16197197
[ "MIT" ]
48
2018-07-22T16:02:27.000Z
2022-03-31T17:46:20.000Z
safe_relay_service/tokens/migrations/0011_auto_20190225_1646.py
gnosis/safe-relay-service
e4db2f9b85aab612653785766d4c1f4d16197197
[ "MIT" ]
264
2018-06-11T11:37:55.000Z
2022-03-30T18:29:38.000Z
safe_relay_service/tokens/migrations/0011_auto_20190225_1646.py
gnosis/safe-relay-service
e4db2f9b85aab612653785766d4c1f4d16197197
[ "MIT" ]
24
2018-11-07T19:28:59.000Z
2022-03-19T16:46:59.000Z
# Generated by Django 2.1.7 on 2019-02-25 16:46 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("tokens", "0010_auto_20190124_1709"), ] operations = [ migrations.AlterField( model_name="token", name="relevance", ...
20.842105
59
0.608586
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("tokens", "0010_auto_20190124_1709"), ] operations = [ migrations.AlterField( model_name="token", name="relevance", field=models.PositiveIntegerField(def...
true
true
1c0531307102c3c918c6411544a4b8cfa6f775f3
275
py
Python
biotite/parse_pdb.py
wojdyr/pdb-benchmarks
6f99ef1ad7151c0c637f5f2a2c35a5b4ceb042fe
[ "MIT" ]
30
2016-05-21T18:07:36.000Z
2022-02-25T15:10:49.000Z
biotite/parse_pdb.py
wojdyr/pdb-benchmarks
6f99ef1ad7151c0c637f5f2a2c35a5b4ceb042fe
[ "MIT" ]
7
2016-06-20T22:40:50.000Z
2020-06-17T17:06:10.000Z
biotite/parse_pdb.py
wojdyr/pdb-benchmarks
6f99ef1ad7151c0c637f5f2a2c35a5b4ceb042fe
[ "MIT" ]
6
2016-05-26T14:44:28.000Z
2020-05-26T09:50:47.000Z
# Benchmark the parsing of a PDB file given as an argument import sys import time import biotite.structure.io.pdb as pdb pdb_filepath = sys.argv[1] start = time.time() file = pdb.PDBFile() file.read(pdb_filepath) file.get_structure() end = time.time() print(end - start)
17.1875
58
0.745455
import sys import time import biotite.structure.io.pdb as pdb pdb_filepath = sys.argv[1] start = time.time() file = pdb.PDBFile() file.read(pdb_filepath) file.get_structure() end = time.time() print(end - start)
true
true
1c05339d7b8bbeeb427c8476a80a47beaae93613
4,568
py
Python
tools/festvox/src/phrasyn/calc_break_f1.py
jantunez14/merlin
66d602919aa8d3ca20b77d4515b8214b5b1be508
[ "Apache-2.0" ]
4
2015-05-14T20:44:23.000Z
2019-02-22T21:05:52.000Z
festvox/src/phrasyn/calc_break_f1.py
zeehio/festival_suite
9f555b42f0ba7432a52ba1c8f26cf7482950e38b
[ "BSD-3-Clause" ]
3
2020-06-05T18:09:02.000Z
2021-06-10T20:06:02.000Z
festvox/src/phrasyn/calc_break_f1.py
zeehio/festival_suite
9f555b42f0ba7432a52ba1c8f26cf7482950e38b
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python ########################################################################### ## ## ## Language Technologies Institute ## ## Carnegie Mellon University ...
42.691589
92
0.454904
## 4. The authors' names are not used to endorse or promote products ## import sys if len(sys.argv) != 3: print >>sys.stderr, "Usage: %s hypfile reffile"%sys.argv[0] sys.exit(-1) taglist = ['3','1'] f = open(sys.argv[1]) g = open(sys.argv[2]) counts = {} for i in taglist: counts[i] = {} for j i...
false
true
1c053408803fbe2d1b3412887981cbf595fa7bf5
8,994
py
Python
venv/lib/python3.6/site-packages/_pytest/cacheprovider.py
mattkantor/basic-flask-app
ec893ca44b1c9c4772c24b81394b58644fefd29a
[ "MIT" ]
null
null
null
venv/lib/python3.6/site-packages/_pytest/cacheprovider.py
mattkantor/basic-flask-app
ec893ca44b1c9c4772c24b81394b58644fefd29a
[ "MIT" ]
null
null
null
venv/lib/python3.6/site-packages/_pytest/cacheprovider.py
mattkantor/basic-flask-app
ec893ca44b1c9c4772c24b81394b58644fefd29a
[ "MIT" ]
null
null
null
""" merged implementation of the cache provider the name cache was not choosen to ensure pluggy automatically ignores the external pytest-cache """ import py import pytest import json from os.path import sep as _sep, altsep as _altsep class Cache(object): def __init__(self, config): self....
36.860656
80
0.572715
import py import pytest import json from os.path import sep as _sep, altsep as _altsep class Cache(object): def __init__(self, config): self.config = config self._cachedir = config.rootdir.join(".cache") self.trace = config.trace.root.get("cache") if config.getvalue("c...
true
true
1c05347d16b309549143844d4e85202ddaa0b515
287
py
Python
app/user/urls.py
MiguelMolledo/BackendApp
e2d240dc185f388b166f6b418fb3cea5f1ad70ff
[ "MIT" ]
null
null
null
app/user/urls.py
MiguelMolledo/BackendApp
e2d240dc185f388b166f6b418fb3cea5f1ad70ff
[ "MIT" ]
null
null
null
app/user/urls.py
MiguelMolledo/BackendApp
e2d240dc185f388b166f6b418fb3cea5f1ad70ff
[ "MIT" ]
null
null
null
from django.urls import path from user import views app_name = 'user' urlpatterns = [ path('create/', views.CreateUserView.as_view(), name='create'), path('token/', views.CreateTokenView.as_view(), name='token'), path('me/', views.ManageUserView.as_view(), name='me'), ]
22.076923
67
0.679443
from django.urls import path from user import views app_name = 'user' urlpatterns = [ path('create/', views.CreateUserView.as_view(), name='create'), path('token/', views.CreateTokenView.as_view(), name='token'), path('me/', views.ManageUserView.as_view(), name='me'), ]
true
true
1c0534c4e5a340767647dd21db5f1d72d378c2cd
707
py
Python
config.py
Nyirabazungu/pitcher-app
65f9a98d4df6a2966840d0703bf081aa27d3b324
[ "MIT" ]
null
null
null
config.py
Nyirabazungu/pitcher-app
65f9a98d4df6a2966840d0703bf081aa27d3b324
[ "MIT" ]
null
null
null
config.py
Nyirabazungu/pitcher-app
65f9a98d4df6a2966840d0703bf081aa27d3b324
[ "MIT" ]
null
null
null
import os class Config: SECRET_KEY = os.environ.get('SECRET_KEY') SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://wecode:valentine@localhost/pitch' UPLOADED_PHOTOS_DEST ='app/static/photos' # email configurations MAIL_SERVER ='smtp.googlemail.com' MAIL_PORT = 587 MAIL_USE_TLS = True ...
21.424242
86
0.718529
import os class Config: SECRET_KEY = os.environ.get('SECRET_KEY') SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://wecode:valentine@localhost/pitch' UPLOADED_PHOTOS_DEST ='app/static/photos' MAIL_SERVER ='smtp.googlemail.com' MAIL_PORT = 587 MAIL_USE_TLS = True MAIL_USERNAME = os.envir...
true
true
1c05357612c5e7fa6cdce357147641896570ccc3
13,619
py
Python
airflow/cli/commands/task_command.py
mebelousov/airflow
d99833c9b5be9eafc0c7851343ee86b6c20aed40
[ "Apache-2.0" ]
1
2020-02-03T19:54:01.000Z
2020-02-03T19:54:01.000Z
airflow/cli/commands/task_command.py
mebelousov/airflow
d99833c9b5be9eafc0c7851343ee86b6c20aed40
[ "Apache-2.0" ]
8
2021-02-08T20:40:47.000Z
2022-03-29T22:27:53.000Z
airflow/cli/commands/task_command.py
mebelousov/airflow
d99833c9b5be9eafc0c7851343ee86b6c20aed40
[ "Apache-2.0" ]
2
2021-01-11T13:53:03.000Z
2021-10-02T05:06:34.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...
33.962594
107
0.662457
import importlib import json import logging import os import textwrap from contextlib import redirect_stderr, redirect_stdout from typing import List from tabulate import tabulate from airflow import settings from airflow.configuration import conf from airflow.exceptions import AirflowException from airflow.executors...
true
true
1c053588826b9893c44343bf92a574793fb3a41a
4,483
py
Python
src/core/collision.py
xDUDSSx/BattleCity-Python
490348af708d2552a500ff5464de308436bb45c0
[ "MIT" ]
1
2022-02-15T11:34:09.000Z
2022-02-15T11:34:09.000Z
src/core/collision.py
xDUDSSx/BattleCity-Python
490348af708d2552a500ff5464de308436bb45c0
[ "MIT" ]
null
null
null
src/core/collision.py
xDUDSSx/BattleCity-Python
490348af708d2552a500ff5464de308436bb45c0
[ "MIT" ]
null
null
null
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from core.map import Map from core.entity_manager import EntityManager from typing import Union import itertools from pyglet.shapes import Rectangle from core import utils from core import constants from core.entities impor...
36.447154
114
0.675664
from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: from core.map import Map from core.entity_manager import EntityManager from typing import Union import itertools from pyglet.shapes import Rectangle from core import utils from core import constants from core.entities impor...
true
true
1c053698781c504a78c3a0e4ec390da07d39d954
567
py
Python
examples/pyplot/plot0_multi.py
danielhrisca/vedo
487568b7956a67b87752e3d518ba3f7e87b327a6
[ "CC0-1.0" ]
null
null
null
examples/pyplot/plot0_multi.py
danielhrisca/vedo
487568b7956a67b87752e3d518ba3f7e87b327a6
[ "CC0-1.0" ]
null
null
null
examples/pyplot/plot0_multi.py
danielhrisca/vedo
487568b7956a67b87752e3d518ba3f7e87b327a6
[ "CC0-1.0" ]
null
null
null
"""Use of plot() function analogous to matplotlib""" import numpy as np, vtk from vedo import * from vedo.pyplot import plot x = np.linspace(0, 5, 10) plt1 = plot(x, x*x, 'sg-', title='Plot1: y=x*x') plt2 = plot(x, cos(x), 'pr--', title='Plot2: y=cos(x)') plt3 = plot(x, sqrt(x),'Db-', title='Plot3: y=sqrt(x)') p...
35.4375
74
0.636684
import numpy as np, vtk from vedo import * from vedo.pyplot import plot x = np.linspace(0, 5, 10) plt1 = plot(x, x*x, 'sg-', title='Plot1: y=x*x') plt2 = plot(x, cos(x), 'pr--', title='Plot2: y=cos(x)') plt3 = plot(x, sqrt(x),'Db-', title='Plot3: y=sqrt(x)') plt4 = plot(x, sin(x), '*t--', title='Plot4: y=sin(x)'...
true
true
1c05369dbee795ee28b32416a710dd4c0f072ff0
955
py
Python
rasterTools/_dev_RasterizePolygon.py
baumi-berlin/baumiTools
febfc79812eb60116780cf2233f5dcffa07e4c6c
[ "MIT" ]
1
2018-11-09T14:47:07.000Z
2018-11-09T14:47:07.000Z
rasterTools/_dev_RasterizePolygon.py
baumi-berlin/baumiTools
febfc79812eb60116780cf2233f5dcffa07e4c6c
[ "MIT" ]
null
null
null
rasterTools/_dev_RasterizePolygon.py
baumi-berlin/baumiTools
febfc79812eb60116780cf2233f5dcffa07e4c6c
[ "MIT" ]
1
2018-07-12T15:23:06.000Z
2018-07-12T15:23:06.000Z
def RasterizeExtentPolygon(SHPpath, refRaster): import ogr, gdal drvMemV = ogr.GetDriverByName('Memory') drvMemR = gdal.GetDriverByName('MEM') # Get info from the refRaster pr = refRaster.GetProjection() gt = refRaster.GetGeoTransform() cols = refRaster.RasterXSize rows = refRaster.RasterYS...
36.730769
58
0.694241
def RasterizeExtentPolygon(SHPpath, refRaster): import ogr, gdal drvMemV = ogr.GetDriverByName('Memory') drvMemR = gdal.GetDriverByName('MEM') pr = refRaster.GetProjection() gt = refRaster.GetGeoTransform() cols = refRaster.RasterXSize rows = refRaster.RasterYSize shape = drvMemV.Co...
true
true
1c0536ed21cb8ade32c38246a8bf57720cd737ec
2,362
py
Python
qiskit/pulse/instructions/snapshot.py
ajavadia/qiskit-sdk-py
a59e8e6be1793197e19998c1f7dcfc45e6f2f3af
[ "Apache-2.0" ]
15
2020-06-29T08:33:39.000Z
2022-02-12T00:28:51.000Z
qiskit/pulse/instructions/snapshot.py
ajavadia/qiskit-sdk-py
a59e8e6be1793197e19998c1f7dcfc45e6f2f3af
[ "Apache-2.0" ]
6
2021-01-17T17:56:08.000Z
2021-04-01T12:40:21.000Z
qiskit/pulse/instructions/snapshot.py
ajavadia/qiskit-sdk-py
a59e8e6be1793197e19998c1f7dcfc45e6f2f3af
[ "Apache-2.0" ]
11
2020-06-29T08:40:24.000Z
2022-02-24T17:39:16.000Z
# This code is part of Qiskit. # # (C) Copyright IBM 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
38.096774
99
0.674852
from typing import Optional from qiskit.pulse.channels import SnapshotChannel from qiskit.pulse.exceptions import PulseError from qiskit.pulse.instructions.instruction import Instruction class Snapshot(Instruction): def __init__(self, label: str, snapshot_type: str = 'statevector', name: Optional[str] = None):...
true
true
1c053710dcf16897102c1416f5b450020a52425e
1,146
py
Python
python/matplotlib/contours/contours_only.py
jeremiedecock/snippets
4bd4e7f459eee610d5cf19f845299ca942ff4b64
[ "MIT" ]
23
2015-06-08T13:01:00.000Z
2021-12-30T08:20:04.000Z
python/matplotlib/contours/contours_only.py
jeremiedecock/snippets
4bd4e7f459eee610d5cf19f845299ca942ff4b64
[ "MIT" ]
1
2020-10-22T02:36:10.000Z
2020-10-22T02:36:10.000Z
python/matplotlib/contours/contours_only.py
jeremiedecock/snippets
4bd4e7f459eee610d5cf19f845299ca942ff4b64
[ "MIT" ]
7
2017-10-31T09:48:14.000Z
2022-01-04T15:59:45.000Z
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org) # See http://matplotlib.org/api/axes_api.html?highlight=contour#matplotlib.axes.Axes.contour import math import numpy as np import matplotlib import matplotlib.cm as cm import matplotlib.mlab as mlab import matp...
22.038462
92
0.581152
import math import numpy as np import matplotlib import matplotlib.cm as cm import matplotlib.mlab as mlab import matplotlib.pyplot as plt def main(): matplotlib.rcParams['xtick.direction'] = 'out' matplotlib.rcParams['ytick.direction'] = 'out' delta = 0.025 x = np.arange(-3.0, 3.0, delta) ...
true
true
1c0537122f2cde2d3b3348fa378eb9f94b69dc2d
653
py
Python
tests/test_parser.py
coast-team/sqlschm
b5d5a9c904bbaaece1cba9ea7251bda91d77b290
[ "Apache-2.0" ]
null
null
null
tests/test_parser.py
coast-team/sqlschm
b5d5a9c904bbaaece1cba9ea7251bda91d77b290
[ "Apache-2.0" ]
null
null
null
tests/test_parser.py
coast-team/sqlschm
b5d5a9c904bbaaece1cba9ea7251bda91d77b290
[ "Apache-2.0" ]
null
null
null
from sqlschm.parser import parse_schema import black from black import mode import os CORPUS = "tests_corpus/valid/" def test_valid_schema(): files = list(os.listdir(CORPUS)) files.sort() for schm_name in files: if schm_name.endswith(".sql"): out_name = CORPUS + schm_name[:-4] + ".ast...
31.095238
76
0.629403
from sqlschm.parser import parse_schema import black from black import mode import os CORPUS = "tests_corpus/valid/" def test_valid_schema(): files = list(os.listdir(CORPUS)) files.sort() for schm_name in files: if schm_name.endswith(".sql"): out_name = CORPUS + schm_name[:-4] + ".ast...
true
true
1c0537281d9971b192e76a0307277da0f3744387
1,103
py
Python
pysubs2/webvtt.py
r4fek/pysubs2
20281be6902e1a817f1b9537409cef732224684c
[ "MIT" ]
null
null
null
pysubs2/webvtt.py
r4fek/pysubs2
20281be6902e1a817f1b9537409cef732224684c
[ "MIT" ]
null
null
null
pysubs2/webvtt.py
r4fek/pysubs2
20281be6902e1a817f1b9537409cef732224684c
[ "MIT" ]
null
null
null
import re from .subrip import SubripFormat from .time import make_time class WebVTTFormat(SubripFormat): """ Web Video Text Tracks (WebVTT) subtitle format implementation Currently, this shares implementation with :class:`pysubs2.subrip.SubripFormat`. """ TIMESTAMP = re.compile(r"(\d{0,4}:)?(\d{...
28.282051
84
0.582956
import re from .subrip import SubripFormat from .time import make_time class WebVTTFormat(SubripFormat): TIMESTAMP = re.compile(r"(\d{0,4}:)?(\d{2}):(\d{2})\.(\d{2,3})") TIMESTAMP_FORMAT = "%02d:%02d:%02d.%03d" @staticmethod def timestamp_to_ms(groups): _h, _m, _s, _ms = groups if no...
true
true
1c053767241a7e41e9d61197e148ce437058debc
1,734
py
Python
aries_cloudagent/protocols/present_proof/v2_0/message_types.py
zanost/aries-cloudagent-python
9541edfb957742e9db8082981c8397b45f8de987
[ "Apache-2.0" ]
247
2019-07-02T21:10:21.000Z
2022-03-30T13:55:33.000Z
aries_cloudagent/protocols/present_proof/v2_0/message_types.py
estrehle/aries-cloudagent-python
1460b2d32c933944b4677cf25a78c4ace07346c8
[ "Apache-2.0" ]
1,462
2019-07-02T20:57:30.000Z
2022-03-31T23:13:35.000Z
aries_cloudagent/protocols/present_proof/v2_0/message_types.py
estrehle/aries-cloudagent-python
1460b2d32c933944b4677cf25a78c4ace07346c8
[ "Apache-2.0" ]
377
2019-06-20T21:01:31.000Z
2022-03-30T08:27:53.000Z
"""Message and inner object type identifiers for present-proof protocol v2.0.""" from ...didcomm_prefix import DIDCommPrefix from .messages.pres_format import V20PresFormat SPEC_URI = ( "https://github.com/hyperledger/aries-rfcs/tree/" "eace815c3e8598d4a8dd7881d8c731fdb2bcc0aa/features/0454-present-proof-v2"...
36.125
87
0.732987
from ...didcomm_prefix import DIDCommPrefix from .messages.pres_format import V20PresFormat SPEC_URI = ( "https://github.com/hyperledger/aries-rfcs/tree/" "eace815c3e8598d4a8dd7881d8c731fdb2bcc0aa/features/0454-present-proof-v2" ) PRES_20_PROPOSAL = "present-proof/2.0/propose-presentation" PRES_20_REQUEST =...
true
true
1c0537df31bdea17956ba57ae57cd8ba52d9fb2f
888
py
Python
cnf.py
russellw/ml
afc51f763185c18fd659264a448ec4a155ee7f4d
[ "MIT" ]
null
null
null
cnf.py
russellw/ml
afc51f763185c18fd659264a448ec4a155ee7f4d
[ "MIT" ]
null
null
null
cnf.py
russellw/ml
afc51f763185c18fd659264a448ec4a155ee7f4d
[ "MIT" ]
null
null
null
import subprocess from prover import * def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def prformula(c): reset_var_names() pr("cnf") pr("(") # name pr(c.name) pr(", ") # role if hasattr(c, "role"): pr(c.role) else: pr("plain") pr(",...
15.857143
47
0.546171
import subprocess from prover import * def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def prformula(c): reset_var_names() pr("cnf") pr("(") pr(c.name) pr(", ") if hasattr(c, "role"): pr(c.role) else: pr("plain") pr(", ") a...
true
true
1c05389d59261cc15af92fd812cede5c82d07ace
22,680
py
Python
pyVNC/rfb.py
cosmik2002/pyVNC
d90254d8c1841773ef3457310df74b7f7985072b
[ "MIT" ]
1
2021-04-16T20:23:04.000Z
2021-04-16T20:23:04.000Z
pyVNC/rfb.py
cosmik2002/pyVNC
d90254d8c1841773ef3457310df74b7f7985072b
[ "MIT" ]
null
null
null
pyVNC/rfb.py
cosmik2002/pyVNC
d90254d8c1841773ef3457310df74b7f7985072b
[ "MIT" ]
1
2021-05-26T11:25:35.000Z
2021-05-26T11:25:35.000Z
""" RFB protocol implementattion, client side. Override RFBClient and RFBFactory in your application. See vncviewer.py for an example. Reference: http://www.realvnc.com/docs/rfbproto.pdf (C) 2003 cliechti@gmx.net MIT License """ from struct import pack, unpack from twisted.protocols.policies import TimeoutMixin f...
34.892308
125
0.573589
from struct import pack, unpack from twisted.protocols.policies import TimeoutMixin from twisted.python import log from twisted.internet.protocol import Protocol from twisted.internet import protocol from pyVNC import pyDes RAW_ENCODING = 0 COPY_RECTANGLE_ENCODING = 1 RRE_ENCODING = 2 CORRE_ENCODING = 4 HEXTILE_ENC...
true
true
1c0538a80b1a8ae28bd9b0ad3a367511931c8138
3,298
py
Python
maigret/result.py
Anton771/maigret
9c943c6bba3c3f9adf48efc23db5f47d5f18ce8a
[ "MIT" ]
14
2020-11-11T07:28:39.000Z
2022-03-30T09:17:26.000Z
maigret/result.py
LukaDiablo/maigret
806a02c935882e0821bee5e90c4a085e59caea3a
[ "MIT" ]
null
null
null
maigret/result.py
LukaDiablo/maigret
806a02c935882e0821bee5e90c4a085e59caea3a
[ "MIT" ]
3
2021-05-05T09:41:18.000Z
2022-02-16T03:46:54.000Z
"""Sherlock Result Module This module defines various objects for recording the results of queries. """ from enum import Enum class QueryStatus(Enum): """Query Status Enumeration. Describes status of query about a given username. """ CLAIMED = "Claimed" #Username Detected AVAILABLE = "Availa...
35.847826
81
0.540631
from enum import Enum class QueryStatus(Enum): CLAIMED = "Claimed" AVAILABLE = "Available" UNKNOWN = "Unknown" ILLEGAL = "Illegal" def __str__(self): return self.value class QueryResult(): def __init__(self, username, site_name, site_url_user, status, ids_data=None, ...
true
true
1c0539efce51a83ca38b6d57744734069afb7906
2,026
py
Python
src/models.py
mohammad2928/image-classification
ca16c3df9487740f0e9ad7246f8e6da92db9d57e
[ "MIT" ]
null
null
null
src/models.py
mohammad2928/image-classification
ca16c3df9487740f0e9ad7246f8e6da92db9d57e
[ "MIT" ]
null
null
null
src/models.py
mohammad2928/image-classification
ca16c3df9487740f0e9ad7246f8e6da92db9d57e
[ "MIT" ]
null
null
null
from keras.models import Sequential from keras.layers.convolutional import Conv2D from keras.layers.convolutional import MaxPooling2D from keras.layers.core import Activation from keras.layers.core import Flatten from keras.layers.core import Dense from keras.optimizers import Adam class Models: def __i...
39.72549
100
0.640178
from keras.models import Sequential from keras.layers.convolutional import Conv2D from keras.layers.convolutional import MaxPooling2D from keras.layers.core import Activation from keras.layers.core import Flatten from keras.layers.core import Dense from keras.optimizers import Adam class Models: def __i...
true
true
1c053a4c35e4ae5c675ed6c78a3de4e30ce16e41
476
py
Python
src/main/python/aut/common.py
h324yang/aut
5cb05f72ed18852364f084adf3417eced2cb8e91
[ "Apache-2.0" ]
1
2019-04-28T17:32:50.000Z
2019-04-28T17:32:50.000Z
src/main/python/aut/common.py
h324yang/aut
5cb05f72ed18852364f084adf3417eced2cb8e91
[ "Apache-2.0" ]
null
null
null
src/main/python/aut/common.py
h324yang/aut
5cb05f72ed18852364f084adf3417eced2cb8e91
[ "Apache-2.0" ]
null
null
null
from pyspark.sql import DataFrame class WebArchive: def __init__(self, sc, sqlContext, path): self.sc = sc self.sqlContext = sqlContext self.loader = sc._jvm.io.archivesunleashed.DataFrameLoader(sc._jsc.sc()) self.path = path def pages(self): return DataFrame(self.loade...
29.75
83
0.691176
from pyspark.sql import DataFrame class WebArchive: def __init__(self, sc, sqlContext, path): self.sc = sc self.sqlContext = sqlContext self.loader = sc._jvm.io.archivesunleashed.DataFrameLoader(sc._jsc.sc()) self.path = path def pages(self): return DataFrame(self.loade...
true
true
1c053ad8470ec5adb4b750bbf05f05ef79db69e7
4,086
py
Python
notebooks/documentation/notebook_with_added_picture.py
Dzirik/ds_ml_template
b9c63ea5836c478ec7a88a1bf5a8129c29d92b3a
[ "MIT" ]
null
null
null
notebooks/documentation/notebook_with_added_picture.py
Dzirik/ds_ml_template
b9c63ea5836c478ec7a88a1bf5a8129c29d92b3a
[ "MIT" ]
null
null
null
notebooks/documentation/notebook_with_added_picture.py
Dzirik/ds_ml_template
b9c63ea5836c478ec7a88a1bf5a8129c29d92b3a
[ "MIT" ]
null
null
null
# --- # jupyter: # jupytext: # formats: ipynb,py:light # text_representation: # extension: .py # format_name: light # format_version: '1.5' # jupytext_version: 1.13.7 # kernelspec: # display_name: Python 3 (ipykernel) # language: python # name: python3 # --- # # Notebook...
24.763636
201
0.662506
import sys import os sys.path+=[os.path.join(os.getcwd(), ".."), os.path.join(os.getcwd(), "../..")] from src.utils.notebook_support_functions import create_button, get_notebook_name from src.utils.logger import Logger from src.utils.envs import Envs from src.utils.config import Config from pandas import optio...
true
true
1c053b98a4f0f83117676d562193de0c0879d770
3,121
py
Python
packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline/pipeline_invoker.py
Indexical-Metrics-Measure-Advisory/watchmen
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
[ "MIT" ]
null
null
null
packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline/pipeline_invoker.py
Indexical-Metrics-Measure-Advisory/watchmen
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
[ "MIT" ]
null
null
null
packages/watchmen-pipeline-kernel/src/watchmen_pipeline_kernel/pipeline/pipeline_invoker.py
Indexical-Metrics-Measure-Advisory/watchmen
c54ec54d9f91034a38e51fd339ba66453d2c7a6d
[ "MIT" ]
null
null
null
from typing import Optional from watchmen_auth import PrincipalService from watchmen_data_kernel.meta import TenantService, TopicService from watchmen_data_kernel.topic_schema import TopicSchema from watchmen_model.admin import User, UserRole from watchmen_model.pipeline_kernel import PipelineTriggerData, PipelineTrig...
40.012821
107
0.82794
from typing import Optional from watchmen_auth import PrincipalService from watchmen_data_kernel.meta import TenantService, TopicService from watchmen_data_kernel.topic_schema import TopicSchema from watchmen_model.admin import User, UserRole from watchmen_model.pipeline_kernel import PipelineTriggerData, PipelineTrig...
true
true
1c053bb1376c3108ccddb91cdee6f7fbd7aa17fc
9,694
py
Python
heat/engine/dependencies.py
ISCAS-VDI/heat-base
ca8390434edfd8396c7e46651e1e31ff488b2307
[ "Apache-2.0" ]
1
2015-12-18T21:46:55.000Z
2015-12-18T21:46:55.000Z
heat/engine/dependencies.py
ISCAS-VDI/heat-base
ca8390434edfd8396c7e46651e1e31ff488b2307
[ "Apache-2.0" ]
null
null
null
heat/engine/dependencies.py
ISCAS-VDI/heat-base
ca8390434edfd8396c7e46651e1e31ff488b2307
[ "Apache-2.0" ]
null
null
null
# # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # ...
33.659722
79
0.61079
import collections import itertools import six from heat.common import exception from heat.common.i18n import _ from heat.common.i18n import repr_wrapper class CircularDependencyException(exception.HeatException): msg_fmt = _("Circular Dependency Found: %(cycle)s") @repr_wrapper @six.python_2_unicode_compati...
true
true
1c053c77f9d291bed576496de6ae650c822b2f23
3,119
py
Python
appGUI/VisPyTesselators.py
DannyPol/flatcam
25a8634d0658e98b7fae31a095f8bef40c1b3067
[ "MIT" ]
1
2022-02-11T06:19:34.000Z
2022-02-11T06:19:34.000Z
appGUI/VisPyTesselators.py
MRemy2/FlatCam
d4f941335ca8a8d5351aab23b396f99da06a9029
[ "MIT" ]
null
null
null
appGUI/VisPyTesselators.py
MRemy2/FlatCam
d4f941335ca8a8d5351aab23b396f99da06a9029
[ "MIT" ]
null
null
null
# ########################################################## # FlatCAM: 2D Post-processing for Manufacturing # # http://flatcam.org # # File Author: Dennis Hayrullin # # Date: 2/5/2016 # # MIT Licence ...
31.19
82
0.540558
from OpenGL import GLU class GLUTess: def __init__(self): self.tris = [] self.pts = [] self.vertex_index = 0 def _on_begin_primitive(self, type): pass def _on_new_vertex(self, vertex): self.tris.append(vertex) def _on_edge_flag(self, flag): pass ...
true
true
1c053e5d8966324884b157d8823095a4852be329
8,619
py
Python
backend/tuber/api/emails.py
msg4real/tuber
9704466bf30ad7e93975b084eef154bc6e30cf6f
[ "MIT" ]
null
null
null
backend/tuber/api/emails.py
msg4real/tuber
9704466bf30ad7e93975b084eef154bc6e30cf6f
[ "MIT" ]
null
null
null
backend/tuber/api/emails.py
msg4real/tuber
9704466bf30ad7e93975b084eef154bc6e30cf6f
[ "MIT" ]
null
null
null
from tuber import app from flask import request, Response, stream_with_context, escape from tuber.models import * from tuber.database import db from tuber.permissions import * from botocore.exceptions import ClientError import datetime import jinja2 import boto3 import lupa from tuber.api import * from tuber.models imp...
44.427835
218
0.605639
from tuber import app from flask import request, Response, stream_with_context, escape from tuber.models import * from tuber.database import db from tuber.permissions import * from botocore.exceptions import ClientError import datetime import jinja2 import boto3 import lupa from tuber.api import * from tuber.models imp...
true
true
1c053ea5993048831cd4e2f13ff521104cdfe465
13,201
py
Python
nova/api/openstack/compute/contrib/admin_actions.py
bopopescu/zknova
8dd09199f5678697be228ffceeaf2c16f6d7319d
[ "Apache-2.0" ]
null
null
null
nova/api/openstack/compute/contrib/admin_actions.py
bopopescu/zknova
8dd09199f5678697be228ffceeaf2c16f6d7319d
[ "Apache-2.0" ]
null
null
null
nova/api/openstack/compute/contrib/admin_actions.py
bopopescu/zknova
8dd09199f5678697be228ffceeaf2c16f6d7319d
[ "Apache-2.0" ]
1
2020-07-24T08:25:25.000Z
2020-07-24T08:25:25.000Z
# Copyright 2011 OpenStack, LLC. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
39.28869
79
0.632831
import os.path import traceback import webob from webob import exc from nova.api.openstack import common from nova.api.openstack import extensions from nova.api.openstack import wsgi from nova import compute from nova.compute import vm_states from nova import exception from nova.openstack.common import log as loggin...
false
true
1c053eb59061bef5bf05e9b25ee95e9737665173
2,637
py
Python
Grundgeruest/forms.py
wmles/scholarium.at
d2356b3e475df772382e035ddcb839fc7dae4305
[ "MIT" ]
1
2017-07-24T10:19:36.000Z
2017-07-24T10:19:36.000Z
Grundgeruest/forms.py
wmles/scholarium.at
d2356b3e475df772382e035ddcb839fc7dae4305
[ "MIT" ]
9
2017-07-26T14:16:08.000Z
2022-03-11T23:14:40.000Z
Grundgeruest/forms.py
wmles/scholarium.at
d2356b3e475df772382e035ddcb839fc7dae4305
[ "MIT" ]
1
2017-03-07T12:38:23.000Z
2017-03-07T12:38:23.000Z
from django import forms from userena.forms import SignupForm from django.contrib.auth import get_user_model from .models import ScholariumProfile#, MeinUserenaSignup from userena.models import UserenaSignup # das ist Absicht, dass das und Mein~ importiert wird from userena.models import UserenaSignup as MeinUserenaSig...
35.16
115
0.67463
from django import forms from userena.forms import SignupForm from django.contrib.auth import get_user_model from .models import ScholariumProfilefrom userena.models import UserenaSignup from userena.models import UserenaSignup as MeinUserenaSignup from userena.utils import generate_sha1, get_profile_model from django_...
true
true
1c053ec90161d18005495528ce5209e32cafecfc
1,118
py
Python
src/test_enough_space.py
nosrac77/code-katas
741c9e60ba5fa53b55964e324ae6d1a34c310ccd
[ "MIT" ]
null
null
null
src/test_enough_space.py
nosrac77/code-katas
741c9e60ba5fa53b55964e324ae6d1a34c310ccd
[ "MIT" ]
null
null
null
src/test_enough_space.py
nosrac77/code-katas
741c9e60ba5fa53b55964e324ae6d1a34c310ccd
[ "MIT" ]
null
null
null
"""Functions that test the enough function.""" def test_one_enough_code_wars(): """Function that emulates test.assert_equals(enough(10, 5, 5)) from code wars.""" from enough_space import enough assert enough(10, 5, 5) == 0 def test_two_enough_code_wars(): """Function that emulates test.assert_eq...
25.409091
69
0.683363
def test_one_enough_code_wars(): from enough_space import enough assert enough(10, 5, 5) == 0 def test_two_enough_code_wars(): from enough_space import enough assert enough(100, 60, 50) == 10 def test_one_enough_carson(): from enough_space import enough assert enough(10, 9, 2) == 1 def...
true
true
1c053f6fef097b2799d6c36cce3bc53d58e5d4ab
9,046
py
Python
plugins/moderation/general/general_commands.py
Suffyx/Isaiah
ae68ca96ab478dbf74afd04b8cf2e5f81fe86cd2
[ "MIT" ]
null
null
null
plugins/moderation/general/general_commands.py
Suffyx/Isaiah
ae68ca96ab478dbf74afd04b8cf2e5f81fe86cd2
[ "MIT" ]
null
null
null
plugins/moderation/general/general_commands.py
Suffyx/Isaiah
ae68ca96ab478dbf74afd04b8cf2e5f81fe86cd2
[ "MIT" ]
null
null
null
""" MIT License Copyright (c) 2021 Suffyx 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 rights to use, copy, modify, merge, publish, distri...
33.257353
117
0.63166
import typing import asyncio import discord from discord.ext import commands from discord.commands import slash_command, Option from durations import Duration import core.utils as utils from core import Context from core import Isaiah from constants import BAN_COMMAND from constants import KICK_COMMAND from const...
true
true
1c053f8a60c1bc1a9bad90bbe3d41c9f4d4c6e4e
2,539
py
Python
tests/observables/test_rx_from.py
geronimo-iia/async-rx
366a2fc5e4e717a0441f1ee8522ef6d5e857566c
[ "MIT" ]
4
2020-05-02T00:14:29.000Z
2022-02-12T14:17:21.000Z
tests/observables/test_rx_from.py
geronimo-iia/async-rx
366a2fc5e4e717a0441f1ee8522ef6d5e857566c
[ "MIT" ]
4
2020-05-05T16:21:00.000Z
2021-08-05T23:31:30.000Z
tests/observables/test_rx_from.py
geronimo-iia/async-rx
366a2fc5e4e717a0441f1ee8522ef6d5e857566c
[ "MIT" ]
null
null
null
import pytest from async_rx import Observable, Observer, rx_create, rx_from from async_rx.protocol import default_subscription from ..model import ObserverCounterCollector @pytest.mark.curio async def test_rx_from_dict(): result = rx_from({"A": True}) assert hasattr(result, "subscribe") result["B"] = Fa...
25.908163
79
0.704608
import pytest from async_rx import Observable, Observer, rx_create, rx_from from async_rx.protocol import default_subscription from ..model import ObserverCounterCollector @pytest.mark.curio async def test_rx_from_dict(): result = rx_from({"A": True}) assert hasattr(result, "subscribe") result["B"] = Fa...
true
true
1c0541dc496e6437839cc42c63a44b00180c17c9
1,081
py
Python
mathematics/linear-regression-demo2.py
AgainstWind/python-demos
a90c4481eb770ea1bf508fda75246224b8149a35
[ "Apache-2.0" ]
1
2017-10-16T09:53:24.000Z
2017-10-16T09:53:24.000Z
mathematics/linear-regression-demo2.py
AgainstWind/python-demos
a90c4481eb770ea1bf508fda75246224b8149a35
[ "Apache-2.0" ]
null
null
null
mathematics/linear-regression-demo2.py
AgainstWind/python-demos
a90c4481eb770ea1bf508fda75246224b8149a35
[ "Apache-2.0" ]
null
null
null
import csv import matplotlib.pyplot as plt def loadData(fileName): csv_reader = csv.reader(open(fileName)) # print type(csv_reader) a_x_values = [] a_y_values = [] b_x_values = [] b_y_values = [] rv = {} for row in csv_reader: # print type(row) print row try: ...
25.139535
93
0.60037
import csv import matplotlib.pyplot as plt def loadData(fileName): csv_reader = csv.reader(open(fileName)) a_x_values = [] a_y_values = [] b_x_values = [] b_y_values = [] rv = {} for row in csv_reader: print row try: a_x_values.append(float(row[1])) ...
false
true
1c0543cde190c1343911305192d1d76f21abecc0
1,244
py
Python
mysite/grading/models.py
cjlee112/socraticqs2
2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820
[ "Apache-2.0" ]
8
2015-06-02T15:34:44.000Z
2019-03-21T12:27:30.000Z
mysite/grading/models.py
cjlee112/socraticqs2
2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820
[ "Apache-2.0" ]
761
2015-01-07T05:13:08.000Z
2022-02-10T10:23:37.000Z
mysite/grading/models.py
cjlee112/socraticqs2
2e7dd9d2ec687f68ca8ca341cf5f1b3b8809c820
[ "Apache-2.0" ]
12
2015-01-28T20:09:36.000Z
2018-03-20T13:32:11.000Z
from django.db import models from django.contrib.auth.models import User from django.db.models import Count from ct.models import Response class CorrectnessMeter(models.Model): """User answers correctness meter.""" PARTIALLY_CORRECT_ANSWER_POINT_REDUCTION = 0.9 CORRECT_ANSWER_POINTS = 1 NOT_CORRECT_A...
34.555556
113
0.712219
from django.db import models from django.contrib.auth.models import User from django.db.models import Count from ct.models import Response class CorrectnessMeter(models.Model): PARTIALLY_CORRECT_ANSWER_POINT_REDUCTION = 0.9 CORRECT_ANSWER_POINTS = 1 NOT_CORRECT_ANSWER_POINTS = 0 NOT_CORRECT = 'not_co...
true
true
1c0545460ca8031ef2246b8960e4853c5a4a2b71
7,111
py
Python
virtual/bin/pwiz.py
KellenNjoroge/keller-gallery
ee9ad8c9285af8ff06dda4e75d41fe023db1ee8c
[ "MIT" ]
null
null
null
virtual/bin/pwiz.py
KellenNjoroge/keller-gallery
ee9ad8c9285af8ff06dda4e75d41fe023db1ee8c
[ "MIT" ]
null
null
null
virtual/bin/pwiz.py
KellenNjoroge/keller-gallery
ee9ad8c9285af8ff06dda4e75d41fe023db1ee8c
[ "MIT" ]
null
null
null
#!/home/kellen/Moringa/django/keller-gallery/virtual/bin/python import datetime import sys from getpass import getpass from optparse import OptionParser from peewee import * from peewee import print_ from peewee import __version__ as peewee_version from playhouse.reflection import * TEMPLATE = """from peewee import ...
35.733668
79
0.596962
import datetime import sys from getpass import getpass from optparse import OptionParser from peewee import * from peewee import print_ from peewee import __version__ as peewee_version from playhouse.reflection import * TEMPLATE = """from peewee import *%s database = %s('%s', **%s) class UnknownField(object): ...
true
true
1c05462a6d4aadae143ba8b1d527f78ddd371039
19,803
py
Python
scionlab/tests/test_user_as_views.py
code-review-doctor/scionlab
9c16791c78593036006013f19c1253b70dc08ef3
[ "Apache-2.0" ]
8
2019-04-29T13:50:01.000Z
2022-01-31T12:43:42.000Z
scionlab/tests/test_user_as_views.py
code-review-doctor/scionlab
9c16791c78593036006013f19c1253b70dc08ef3
[ "Apache-2.0" ]
203
2018-10-15T08:45:10.000Z
2022-03-22T08:07:12.000Z
scionlab/tests/test_user_as_views.py
code-review-doctor/scionlab
9c16791c78593036006013f19c1253b70dc08ef3
[ "Apache-2.0" ]
13
2018-10-11T15:20:14.000Z
2022-01-11T12:13:12.000Z
# Copyright 2018 ETH Zurich # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
42.771058
100
0.672928
import os import re import yaml import pathlib from django.conf import settings from django.test import TestCase from parameterized import parameterized from django.urls import reverse from django_webtest import WebTest from scionlab.models.user_as import UserAS, AttachmentPoint, AttachmentConf from scionlab.defines ...
true
true
1c05469d9f5bdeb29ad6510990b79da1e1df552a
1,422
py
Python
lib/surface/runtime_config/configs/variables/describe.py
kustodian/google-cloud-sdk
b6bae4137d4b58030adb3dcb1271216dfb19f96d
[ "Apache-2.0" ]
null
null
null
lib/surface/runtime_config/configs/variables/describe.py
kustodian/google-cloud-sdk
b6bae4137d4b58030adb3dcb1271216dfb19f96d
[ "Apache-2.0" ]
11
2020-02-29T02:51:12.000Z
2022-03-30T23:20:08.000Z
lib/surface/runtime_config/configs/variables/describe.py
kustodian/google-cloud-sdk
b6bae4137d4b58030adb3dcb1271216dfb19f96d
[ "Apache-2.0" ]
1
2020-07-24T18:47:35.000Z
2020-07-24T18:47:35.000Z
# -*- coding: utf-8 -*- # # Copyright 2016 Google LLC. 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 requir...
31.6
74
0.73699
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals from googlecloudsdk.api_lib.runtime_config import util from googlecloudsdk.command_lib.runtime_config import base_commands class Describe(base_commands.VariableRetrieverCommand): detailed_help = { ...
true
true
1c0548232067fa1bd216ee8ff1bf7f4cc606f811
681
py
Python
trails/feeds/bruteforceblocker.py
gitty8/maltrail
3da04d0a1b46edb5a448189f02c63d4f26e65146
[ "MIT" ]
2
2021-04-06T06:53:00.000Z
2021-04-24T23:11:03.000Z
trails/feeds/bruteforceblocker.py
oandersonbsilva/maltrail
8be811cf798c7562c81ab5a4d00e08e113f526a9
[ "MIT" ]
null
null
null
trails/feeds/bruteforceblocker.py
oandersonbsilva/maltrail
8be811cf798c7562c81ab5a4d00e08e113f526a9
[ "MIT" ]
2
2018-10-23T08:11:04.000Z
2019-10-09T08:04:59.000Z
#!/usr/bin/env python """ Copyright (c) 2014-2017 Miroslav Stampar (@stamparm) See the file 'LICENSE' for copying permission """ from core.common import retrieve_content __url__ = "http://danger.rulez.sk/projects/bruteforceblocker/blist.php" __check__ = "Last Reported" __info__ = "known attacker" __reference__ = "ru...
25.222222
71
0.647577
from core.common import retrieve_content __url__ = "http://danger.rulez.sk/projects/bruteforceblocker/blist.php" __check__ = "Last Reported" __info__ = "known attacker" __reference__ = "rulez.sk" def fetch(): retval = {} content = retrieve_content(__url__) if __check__ in content: for line in c...
true
true
1c0549adac4215c69897f6d4bfb3429942a04918
4,958
py
Python
coramin/relaxations/alphabb.py
jsiirola/Coramin
e5dd359ca885794c05447ff28f0f8aaf9c86da6e
[ "BSD-3-Clause" ]
null
null
null
coramin/relaxations/alphabb.py
jsiirola/Coramin
e5dd359ca885794c05447ff28f0f8aaf9c86da6e
[ "BSD-3-Clause" ]
null
null
null
coramin/relaxations/alphabb.py
jsiirola/Coramin
e5dd359ca885794c05447ff28f0f8aaf9c86da6e
[ "BSD-3-Clause" ]
null
null
null
import pyomo.environ as pyo from pyomo.core.kernel.component_map import ComponentMap from pyomo.contrib.derivatives.differentiate import reverse_sd from pyomo.contrib.fbbt.fbbt import compute_bounds_on_expr from coramin.utils.coramin_enums import RelaxationSide from coramin.relaxations.custom_block import declare_custo...
31.18239
113
0.651472
import pyomo.environ as pyo from pyomo.core.kernel.component_map import ComponentMap from pyomo.contrib.derivatives.differentiate import reverse_sd from pyomo.contrib.fbbt.fbbt import compute_bounds_on_expr from coramin.utils.coramin_enums import RelaxationSide from coramin.relaxations.custom_block import declare_custo...
true
true
1c0549beb1a5245f0284174f150cab9744d41c8b
1,149
py
Python
scripts/misc.py
Lila14/miniMDS
0ac01964edebc3d33e666f66a59f36f05702bede
[ "MIT" ]
19
2017-04-12T01:58:20.000Z
2020-10-24T09:27:48.000Z
scripts/misc.py
Lila14/miniMDS
0ac01964edebc3d33e666f66a59f36f05702bede
[ "MIT" ]
17
2017-04-03T09:56:31.000Z
2020-11-04T06:56:00.000Z
scripts/misc.py
Lila14/miniMDS
0ac01964edebc3d33e666f66a59f36f05702bede
[ "MIT" ]
10
2017-03-31T21:05:06.000Z
2019-04-15T14:21:46.000Z
import numpy as np from scipy import stats as st import sys sys.path.append("..") import linear_algebra as la def distsFromCoords(coords): """Creates distance matrix from 3D coords""" n = len(coords) distMat = np.zeros((n,n)) for i in range(n): for j in range(i): distMat[i,j] = la.calcDistance(coords[i], coor...
24.978261
73
0.690165
import numpy as np from scipy import stats as st import sys sys.path.append("..") import linear_algebra as la def distsFromCoords(coords): n = len(coords) distMat = np.zeros((n,n)) for i in range(n): for j in range(i): distMat[i,j] = la.calcDistance(coords[i], coords[j]) return distMat def pearson(mat1, mat2...
true
true
1c054a12f1c5691885561517d1e6385995345e7d
6,740
py
Python
One-Round DES Implementation/one-round_DES.py
devedge/Scripts
6a40a7201b699bc2ca54e72f266f9d0495ef4c75
[ "MIT" ]
1
2016-05-06T00:32:47.000Z
2016-05-06T00:32:47.000Z
One-Round DES Implementation/one-round_DES.py
devedge/Scripts
6a40a7201b699bc2ca54e72f266f9d0495ef4c75
[ "MIT" ]
null
null
null
One-Round DES Implementation/one-round_DES.py
devedge/Scripts
6a40a7201b699bc2ca54e72f266f9d0495ef4c75
[ "MIT" ]
null
null
null
import string # The given permutation tables first_PCtable_String = "57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4" second_PCtable_String = "14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,...
33.039216
200
0.583086
import string first_PCtable_String = "57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4" second_PCtable_String = "14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,3...
false
true
1c054b16a7b3664b6869f0e2fe6f925ca8981e71
1,534
py
Python
dimod/__init__.py
kotarotanahashi/dimod
256b7f59c571e16cc562443a1a5388ebdcd3a5e4
[ "Apache-2.0" ]
null
null
null
dimod/__init__.py
kotarotanahashi/dimod
256b7f59c571e16cc562443a1a5388ebdcd3a5e4
[ "Apache-2.0" ]
null
null
null
dimod/__init__.py
kotarotanahashi/dimod
256b7f59c571e16cc562443a1a5388ebdcd3a5e4
[ "Apache-2.0" ]
null
null
null
# Copyright 2018 D-Wave Systems Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
29.5
103
0.737288
from __future__ import absolute_import from dimod.core import * import dimod.core from dimod.reference import * import dimod.reference import dimod.testing from dimod.binary_quadratic_model import * import dimod.binary_quadratic_model import dimod.decorators from dimod.embedding import embed_bqm, embed_ising, em...
true
true
1c054c8c6d92aa593574ec67de981c7f2960150c
2,063
py
Python
core/tests/unittests/test_local_random_searcher.py
killerSwitch/autogluon
11ab6aab35196ef148fb5a8308e92585d9de618a
[ "Apache-2.0" ]
null
null
null
core/tests/unittests/test_local_random_searcher.py
killerSwitch/autogluon
11ab6aab35196ef148fb5a8308e92585d9de618a
[ "Apache-2.0" ]
null
null
null
core/tests/unittests/test_local_random_searcher.py
killerSwitch/autogluon
11ab6aab35196ef148fb5a8308e92585d9de618a
[ "Apache-2.0" ]
null
null
null
from autogluon.core.space import Categorical, Int, Real from autogluon.core.searcher import LocalRandomSearcher def test_local_random_searcher(): search_space = dict( a=Real(0, 1, default=0.2), b=Real(0.05, 1, default=0.4, log=True), c=Int(5, 15), d=Int(7, 23, default=16), ...
38.203704
111
0.660204
from autogluon.core.space import Categorical, Int, Real from autogluon.core.searcher import LocalRandomSearcher def test_local_random_searcher(): search_space = dict( a=Real(0, 1, default=0.2), b=Real(0.05, 1, default=0.4, log=True), c=Int(5, 15), d=Int(7, 23, default=16), ...
true
true
1c054ca6720939f42667708f511d9ecbdb1d3e15
10,254
py
Python
canprog/main.py
jakob-tsd/can-prog
3107200366d7250c217cda373cc63b2815ef1197
[ "MIT" ]
null
null
null
canprog/main.py
jakob-tsd/can-prog
3107200366d7250c217cda373cc63b2815ef1197
[ "MIT" ]
null
null
null
canprog/main.py
jakob-tsd/can-prog
3107200366d7250c217cda373cc63b2815ef1197
[ "MIT" ]
null
null
null
#!/usr/bin/python # # The MIT License (MIT) # # Copyright (c) 2017 Marcin Borowicz <marcinbor85@gmail.com> # # 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 wi...
42.197531
156
0.665496
import argparse import can from canprog import __version__, __appname__, __description__ from canprog import protocols from canprog import file from canprog.logger import log import canprog.logger def config_parser(): parser = argparse.ArgumentParser(prog=__appname__, description=__description__) parser._...
true
true
1c054ca70bfd6d9fc6d7143e7b0073511e261194
1,683
py
Python
tests/test_models.py
RylanGotto/web-dash
15122757b41539668d6e721b8159e683d40f64ab
[ "BSD-3-Clause" ]
null
null
null
tests/test_models.py
RylanGotto/web-dash
15122757b41539668d6e721b8159e683d40f64ab
[ "BSD-3-Clause" ]
null
null
null
tests/test_models.py
RylanGotto/web-dash
15122757b41539668d6e721b8159e683d40f64ab
[ "BSD-3-Clause" ]
null
null
null
# -*- coding: utf-8 -*- """Model unit tests.""" import datetime as dt import pytest from websterton.user.models import User, Role from .factories import UserFactory @pytest.mark.usefixtures('db') class TestUser: def test_get_by_id(self): user = User('foo', 'foo@bar.com') user.save() ret...
29.017241
63
0.629828
import datetime as dt import pytest from websterton.user.models import User, Role from .factories import UserFactory @pytest.mark.usefixtures('db') class TestUser: def test_get_by_id(self): user = User('foo', 'foo@bar.com') user.save() retrieved = User.get_by_id(user.id) assert ...
true
true
1c054f3f7460eb81ca0f208c02347853b5a5b0c3
16,359
py
Python
embera/transform/embedding.py
joseppinilla/embedding-methods
a29fea829ec33d586ccbc5c9b6ec6586c2a2154f
[ "MIT" ]
5
2020-05-11T18:31:35.000Z
2021-09-25T22:00:36.000Z
embera/transform/embedding.py
joseppinilla/embedding-methods
a29fea829ec33d586ccbc5c9b6ec6586c2a2154f
[ "MIT" ]
2
2019-12-21T02:29:23.000Z
2020-05-14T17:45:49.000Z
embera/transform/embedding.py
joseppinilla/embedding-methods
a29fea829ec33d586ccbc5c9b6ec6586c2a2154f
[ "MIT" ]
2
2020-05-11T18:43:39.000Z
2021-05-20T02:02:28.000Z
import minorminer import numpy as np from embera.utilities.decorators import nx_graph from embera.preprocess.tiling_parser import DWaveNetworkXTiling __all__ = ['translate','mirror','rotate','spread_out','open_seam', 'iter_sliding_window', 'greedy_fit','reconnect'] """ ################### Naive Embedding...
38.311475
96
0.585977
import minorminer import numpy as np from embera.utilities.decorators import nx_graph from embera.preprocess.tiling_parser import DWaveNetworkXTiling __all__ = ['translate','mirror','rotate','spread_out','open_seam', 'iter_sliding_window', 'greedy_fit','reconnect'] def translate(T, embedding, origin=(0,...
true
true
1c054f5f53e2b5bbccf15a877dca1473b7c31bae
1,962
py
Python
kiwi_scp/executable.py
ldericher/kiwi-scp
226366561432fa36cac15df09f554ecdb9bcd153
[ "MIT" ]
null
null
null
kiwi_scp/executable.py
ldericher/kiwi-scp
226366561432fa36cac15df09f554ecdb9bcd153
[ "MIT" ]
1
2021-09-22T01:17:52.000Z
2021-09-22T01:17:52.000Z
kiwi_scp/executable.py
ldericher/kiwi-scp
226366561432fa36cac15df09f554ecdb9bcd153
[ "MIT" ]
null
null
null
# system import logging import os import subprocess def _is_executable(filename): if filename is None: return False return os.path.isfile(filename) and os.access(filename, os.X_OK) def _find_exe_file(exe_name): for path in os.environ['PATH'].split(os.pathsep): exe_file = os.path.join(pa...
26.16
80
0.586137
import logging import os import subprocess def _is_executable(filename): if filename is None: return False return os.path.isfile(filename) and os.access(filename, os.X_OK) def _find_exe_file(exe_name): for path in os.environ['PATH'].split(os.pathsep): exe_file = os.path.join(path, exe_n...
true
true
1c054ff22eaacfbd31b934682eca41e26d40b564
2,017
py
Python
jinja2_s3loader/__init__.py
veselosky/jinja2_s3loader
8278a112fd4aa8467a0fb66f2da4324e9cc0a08a
[ "Apache-2.0" ]
1
2019-08-30T16:37:47.000Z
2019-08-30T16:37:47.000Z
jinja2_s3loader/__init__.py
veselosky/jinja2_s3loader
8278a112fd4aa8467a0fb66f2da4324e9cc0a08a
[ "Apache-2.0" ]
1
2016-03-22T16:07:39.000Z
2016-03-22T16:40:19.000Z
jinja2_s3loader/__init__.py
veselosky/jinja2_s3loader
8278a112fd4aa8467a0fb66f2da4324e9cc0a08a
[ "Apache-2.0" ]
3
2018-04-27T10:04:14.000Z
2020-06-02T01:38:13.000Z
# -*- coding: utf-8 -*- # Copyright 2015 Vince Veselosky and contributors. # # 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 require...
33.065574
75
0.677243
from __future__ import absolute_import, print_function from jinja2 import BaseLoader, TemplateNotFound from botocore.exceptions import ClientError import boto3 from gzip import GzipFile from io import BytesIO import posixpath as path def gzip(content, filename=None, compresslevel=9): gzbuffer = BytesIO() gz =...
true
true
1c05506549ac49e151b30f2516ece4102a161ffe
46,728
py
Python
core/tests/test_polyaxonfile/test_patch_specification.py
admariner/polyaxon
ba355c38166047eb11e60de4cee4d7c3b48db323
[ "Apache-2.0" ]
3,200
2017-05-09T11:35:31.000Z
2022-03-28T05:43:22.000Z
core/tests/test_polyaxonfile/test_patch_specification.py
admariner/polyaxon
ba355c38166047eb11e60de4cee4d7c3b48db323
[ "Apache-2.0" ]
1,324
2017-06-29T07:21:27.000Z
2022-03-27T12:41:10.000Z
core/tests/test_polyaxonfile/test_patch_specification.py
admariner/polyaxon
ba355c38166047eb11e60de4cee4d7c3b48db323
[ "Apache-2.0" ]
341
2017-01-10T23:06:53.000Z
2022-03-10T08:15:18.000Z
#!/usr/bin/python # # Copyright 2018-2021 Polyaxon, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
41.833483
93
0.560135
import pytest from polyaxon import pkg, types from polyaxon.config_reader.utils import deep_update from polyaxon.containers.names import MAIN_JOB_CONTAINER from polyaxon.polyaxonfile import OperationSpecification from polyaxon.polyflow import V1Component, V1EventKind, V1Operation, V1RunKind from polyaxon.schemas.patc...
true
true
1c0551ed1b623aff49077cb65a09a20479488a5b
4,469
py
Python
walle/service/websocket.py
showsmall/walle-web
c67437bfdf75d3121c5a40275bdae53b0e33ac4e
[ "Apache-2.0" ]
1
2022-02-18T10:03:57.000Z
2022-02-18T10:03:57.000Z
walle/service/websocket.py
slyang520/walle-web
4dbede773e964b67baa3a434d3ea8c96673177b6
[ "Apache-2.0" ]
null
null
null
walle/service/websocket.py
slyang520/walle-web
4dbede773e964b67baa3a434d3ea8c96673177b6
[ "Apache-2.0" ]
3
2019-01-30T05:43:00.000Z
2020-04-10T06:27:31.000Z
# -*- coding: utf-8 -*- """ walle-web :copyright: © 2015-2019 walle-web.io :created time: 2018-09-06 20:20:33 :author: wushuiyong@walle-web.io """ from flask import current_app from flask_login import current_user, login_required from flask_socketio import emit, join_room, Namespace from walle.model.re...
38.86087
142
0.596554
from flask import current_app from flask_login import current_user, login_required from flask_socketio import emit, join_room, Namespace from walle.model.record import RecordModel from walle.model.task import TaskModel from walle.service.deployer import Deployer from walle.service.error import Code class WalleSocketI...
true
true
1c055273278401f9a7ed91816f6ceb37f87f3df6
2,240
py
Python
NNSolver/Utilities.py
mkaywong/NNSolver
13e43584ec96004441a4877c5f24af270c579f20
[ "BSD-2-Clause" ]
2
2018-12-29T01:07:45.000Z
2021-08-16T17:41:02.000Z
NNSolver/Utilities.py
mkaywong/NNSolver
13e43584ec96004441a4877c5f24af270c579f20
[ "BSD-2-Clause" ]
null
null
null
NNSolver/Utilities.py
mkaywong/NNSolver
13e43584ec96004441a4877c5f24af270c579f20
[ "BSD-2-Clause" ]
null
null
null
#!/usr/bin/env python # coding: utf-8 import numpy as np import matplotlib.pyplot as pt def ImageToArray(batchVol,kernalShape,stride,outArray): """ This procedure convert a 4D volume into a 2D array for convolution computation. Row major is assumed. That is, data contiquous along the channel C in memo...
36.129032
95
0.607143
import numpy as np import matplotlib.pyplot as pt def ImageToArray(batchVol,kernalShape,stride,outArray): N,H,W,C = batchVol.shape k_h,k_w = kernalShape H_out = int((H-k_h)/stride)+1 W_out = int((W-k_w)/stride)+1 ex_h = N*H_out*W_out ex_w = k_h*k_w*C if outArray.shape != (ex_h,ex_w): ...
true
true
1c0553f9013f6a41b2fa36feda24ab9aa37667b9
154,018
py
Python
sdk/python/pulumi_azure_native/containerservice/_inputs.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/containerservice/_inputs.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
sdk/python/pulumi_azure_native/containerservice/_inputs.py
pulumi-bot/pulumi-azure-native
f7b9490b5211544318e455e5cceafe47b628e12c
[ "Apache-2.0" ]
null
null
null
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi SDK Generator. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables from ...
42.985766
551
0.673499
import warnings import pulumi import pulumi.runtime from typing import Any, Mapping, Optional, Sequence, Union from .. import _utilities, _tables from ._enums import * __all__ = [ 'AgentPoolUpgradeSettingsArgs', 'ContainerServiceAgentPoolProfileArgs', 'ContainerServiceCustomProfileArgs', 'ContainerSer...
true
true
1c0555d89c99d10158f10f5841ca4b5c01396c63
6,104
py
Python
sphinx-contrib-markdown-links/markdown_links.py
tronical/sphinx-contrib-mithro
e9cc7cd7abe79c1ff1680d6e8b49428c2c5ec95b
[ "CC0-1.0", "0BSD" ]
4
2018-02-28T22:11:05.000Z
2022-02-04T13:42:19.000Z
sphinx-contrib-markdown-links/markdown_links.py
tronical/sphinx-contrib-mithro
e9cc7cd7abe79c1ff1680d6e8b49428c2c5ec95b
[ "CC0-1.0", "0BSD" ]
1
2019-08-29T16:15:10.000Z
2019-09-06T12:53:03.000Z
sphinx-contrib-markdown-links/markdown_links.py
tronical/sphinx-contrib-mithro
e9cc7cd7abe79c1ff1680d6e8b49428c2c5ec95b
[ "CC0-1.0", "0BSD" ]
2
2020-12-18T14:52:18.000Z
2021-03-22T13:05:47.000Z
import logging import os from recommonmark import transform """ Allow linking of Markdown documentation from the source code tree into the Sphinx documentation tree. The Markdown documents will have links relative to the source code root, rather than the place they are now linked too - this code fixes these paths up...
30.828283
86
0.622379
import logging import os from recommonmark import transform def path_contains(parent_path, child_path): parent_path = os.path.join(os.path.normpath(parent_path), '') child_path = os.path.join(os.path.normpath(child_path), '') common_path = os.path.commonprefix((parent_path, child_path)) r...
true
true
1c0555f3ec860e3dd0711f3e6c1641242dec2cae
9,679
py
Python
corehq/ex-submodules/casexml/apps/case/tests/test_close_extension_chain.py
dborowiecki/commcare-hq
f2f4fa67faec09040a98502f5657444075b63f2e
[ "BSD-3-Clause" ]
null
null
null
corehq/ex-submodules/casexml/apps/case/tests/test_close_extension_chain.py
dborowiecki/commcare-hq
f2f4fa67faec09040a98502f5657444075b63f2e
[ "BSD-3-Clause" ]
null
null
null
corehq/ex-submodules/casexml/apps/case/tests/test_close_extension_chain.py
dborowiecki/commcare-hq
f2f4fa67faec09040a98502f5657444075b63f2e
[ "BSD-3-Clause" ]
null
null
null
import uuid from django.test import TestCase from casexml.apps.case.mock import CaseFactory, CaseIndex, CaseStructure from corehq.form_processor.interfaces.dbaccessors import CaseAccessors from casexml.apps.case.xform import get_extensions_to_close from casexml.apps.phone.tests.utils import create_restore_user from co...
39.345528
113
0.645005
import uuid from django.test import TestCase from casexml.apps.case.mock import CaseFactory, CaseIndex, CaseStructure from corehq.form_processor.interfaces.dbaccessors import CaseAccessors from casexml.apps.case.xform import get_extensions_to_close from casexml.apps.phone.tests.utils import create_restore_user from co...
true
true
1c055718125f5397f7ac60bf1f7e85cee62815e6
570
py
Python
scripts/convert/convert.py
liuyihuicaicloud/klever-model-registry
02cf87fa9313c1ed7bfbf39bd65ae5bb4b8ecf38
[ "Apache-2.0" ]
73
2020-07-16T03:37:25.000Z
2022-03-24T07:07:14.000Z
scripts/convert/convert.py
liuyihuicaicloud/klever-model-registry
02cf87fa9313c1ed7bfbf39bd65ae5bb4b8ecf38
[ "Apache-2.0" ]
215
2020-07-15T06:53:02.000Z
2021-08-21T14:44:32.000Z
scripts/convert/convert.py
liuyihuicaicloud/klever-model-registry
02cf87fa9313c1ed7bfbf39bd65ae5bb4b8ecf38
[ "Apache-2.0" ]
21
2020-07-23T10:18:34.000Z
2022-03-18T14:17:14.000Z
import os import argparse from converter import Converter if __name__ == "__main__": parser = argparse.ArgumentParser(description='Need model path.') parser.add_argument( '--input_dir', help='path to the directory of model needs to be converted', dest='input_dir') parser.add_argu...
28.5
71
0.64386
import os import argparse from converter import Converter if __name__ == "__main__": parser = argparse.ArgumentParser(description='Need model path.') parser.add_argument( '--input_dir', help='path to the directory of model needs to be converted', dest='input_dir') parser.add_argu...
true
true
1c05574dd2081cdc7459e888496879495f623227
1,594
py
Python
kingfisher_scrapy/spiders/uk_contracts_finder.py
spendnetwork/kingfisher-scrape
053910b278eed9b3e79ca2f05a04086300b8bc21
[ "BSD-3-Clause" ]
null
null
null
kingfisher_scrapy/spiders/uk_contracts_finder.py
spendnetwork/kingfisher-scrape
053910b278eed9b3e79ca2f05a04086300b8bc21
[ "BSD-3-Clause" ]
null
null
null
kingfisher_scrapy/spiders/uk_contracts_finder.py
spendnetwork/kingfisher-scrape
053910b278eed9b3e79ca2f05a04086300b8bc21
[ "BSD-3-Clause" ]
null
null
null
import json import scrapy from kingfisher_scrapy.base_spider import BaseSpider class UKContractsFinder(BaseSpider): name = 'uk_contracts_finder' custom_settings = { 'ITEM_PIPELINES': { 'kingfisher_scrapy.pipelines.KingfisherPostPipeline': 400 }, 'HTTPERROR_ALLOW_ALL': Tru...
31.88
107
0.550816
import json import scrapy from kingfisher_scrapy.base_spider import BaseSpider class UKContractsFinder(BaseSpider): name = 'uk_contracts_finder' custom_settings = { 'ITEM_PIPELINES': { 'kingfisher_scrapy.pipelines.KingfisherPostPipeline': 400 }, 'HTTPERROR_ALLOW_ALL': Tru...
true
true
1c0557696cfd30b23b7c6297d93416b4a726fdec
4,638
py
Python
libra_client/lbrtypes/validator_verifier.py
violas-core/violas-client
e8798f7d081ac218b78b81fd7eb2f8da92631a16
[ "MIT" ]
null
null
null
libra_client/lbrtypes/validator_verifier.py
violas-core/violas-client
e8798f7d081ac218b78b81fd7eb2f8da92631a16
[ "MIT" ]
null
null
null
libra_client/lbrtypes/validator_verifier.py
violas-core/violas-client
e8798f7d081ac218b78b81fd7eb2f8da92631a16
[ "MIT" ]
1
2022-01-05T06:49:42.000Z
2022-01-05T06:49:42.000Z
from libra_client.canoser import Struct, Uint64 from libra_client.move_core_types.account_address import AccountAddress as Address from libra_client.crypto.ed25519 import Ed25519PublicKey, Ed25519Signature from libra_client.lbrtypes.rustlib import ensure from libra_client.error import LibraError, StatusCode class Vali...
43.345794
154
0.724881
from libra_client.canoser import Struct, Uint64 from libra_client.move_core_types.account_address import AccountAddress as Address from libra_client.crypto.ed25519 import Ed25519PublicKey, Ed25519Signature from libra_client.lbrtypes.rustlib import ensure from libra_client.error import LibraError, StatusCode class Vali...
true
true
1c0557d6f1d54e9c8f4f6923981d0e84729fdd6c
5,634
py
Python
inferenceLSH/classifier.py
Ottovonxu/islide
5ee9954e378f0b5a0722292351cb3cc74b95c1b3
[ "Apache-2.0" ]
null
null
null
inferenceLSH/classifier.py
Ottovonxu/islide
5ee9954e378f0b5a0722292351cb3cc74b95c1b3
[ "Apache-2.0" ]
null
null
null
inferenceLSH/classifier.py
Ottovonxu/islide
5ee9954e378f0b5a0722292351cb3cc74b95c1b3
[ "Apache-2.0" ]
null
null
null
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils import data import collections from collections import Counter class Network(nn.Module): def __init__(self, input_size, output_size, layer_size): super(Network, self).__init__() self....
29.19171
145
0.700213
import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils import data import collections from collections import Counter class Network(nn.Module): def __init__(self, input_size, output_size, layer_size): super(Network, self).__init__() self....
true
true
1c0558065ece937a0fdffd5dfd8606ba38f2f122
1,592
py
Python
ipypublish/tests/test_convert_bib_and_gloss.py
parmentelat/ipypublish
55aec8a3bf48733fb00541e645971c677ba32682
[ "BSD-3-Clause" ]
220
2017-07-07T08:23:40.000Z
2022-01-17T18:34:38.000Z
ipypublish/tests/test_convert_bib_and_gloss.py
parmentelat/ipypublish
55aec8a3bf48733fb00541e645971c677ba32682
[ "BSD-3-Clause" ]
144
2017-07-07T04:12:50.000Z
2022-01-16T19:05:17.000Z
ipypublish/tests/test_convert_bib_and_gloss.py
parmentelat/ipypublish
55aec8a3bf48733fb00541e645971c677ba32682
[ "BSD-3-Clause" ]
41
2017-07-08T07:09:52.000Z
2021-02-04T20:58:06.000Z
import pytest @pytest.mark.requires_latexmk @pytest.mark.ipynb("nb_with_bib") def test_withbib_latex(ipynb_app): ipynb_app.run( { "conversion": "latex_ipypublish_main", "default_pporder_kwargs": {"create_pdf": True}, } ) ipynb_app.assert_converted_exists() ipynb...
29.481481
68
0.658291
import pytest @pytest.mark.requires_latexmk @pytest.mark.ipynb("nb_with_bib") def test_withbib_latex(ipynb_app): ipynb_app.run( { "conversion": "latex_ipypublish_main", "default_pporder_kwargs": {"create_pdf": True}, } ) ipynb_app.assert_converted_exists() ipynb...
true
true
1c055808c01e592769a5b907d59c1dd6b4598097
21,477
py
Python
mdtoolbelt/formats.py
d-beltran/mdtoolbelt
b9442f37dc0ac66361ba2b1d749e4c549bbe9261
[ "MIT" ]
null
null
null
mdtoolbelt/formats.py
d-beltran/mdtoolbelt
b9442f37dc0ac66361ba2b1d749e4c549bbe9261
[ "MIT" ]
null
null
null
mdtoolbelt/formats.py
d-beltran/mdtoolbelt
b9442f37dc0ac66361ba2b1d749e4c549bbe9261
[ "MIT" ]
null
null
null
import os from typing import Optional, List, Tuple, Callable, Generator from inspect import getfullargspec # Get a filename format def get_format (filename : str) -> str: if not filename: return None return filename.split('.')[-1] # Find a function which is suitable for any of the available request "f...
56.370079
159
0.649253
import os from typing import Optional, List, Tuple, Callable, Generator from inspect import getfullargspec def get_format (filename : str) -> str: if not filename: return None return filename.split('.')[-1] def get_format_set_suitable_function ( available_functions : List[Callable], available_...
true
true
1c05582e1d413166e155eb51ad0beaf9899092fd
29,462
py
Python
legacy/krazy_world_old.py
ysulsky/krazyworld
70eed53462ed94a0d66610e32ef7581553e0bcb5
[ "MIT" ]
18
2018-10-29T18:17:41.000Z
2021-05-08T13:26:12.000Z
legacy/krazy_world_old.py
ysulsky/krazyworld
70eed53462ed94a0d66610e32ef7581553e0bcb5
[ "MIT" ]
1
2019-03-22T08:53:55.000Z
2019-03-22T08:53:55.000Z
legacy/krazy_world_old.py
ysulsky/krazyworld
70eed53462ed94a0d66610e32ef7581553e0bcb5
[ "MIT" ]
3
2019-02-19T20:47:26.000Z
2020-02-13T10:30:00.000Z
from pygame.constants import K_r, K_UP, K_DOWN, K_LEFT, K_RIGHT, K_t, K_a import pygame import numpy as np import sys from collections import OrderedDict import os import random import copy clock = pygame.time.Clock() EASY_GRID_KWARGS = dict(screen_height=256, grid_squares_per_row=5, grid_sc...
42.45245
165
0.561265
from pygame.constants import K_r, K_UP, K_DOWN, K_LEFT, K_RIGHT, K_t, K_a import pygame import numpy as np import sys from collections import OrderedDict import os import random import copy clock = pygame.time.Clock() EASY_GRID_KWARGS = dict(screen_height=256, grid_squares_per_row=5, grid_sc...
true
true
1c0558d2e43e7483f78989bb6083aa2b4e2ccc8e
1,410
py
Python
ProjectEuler/python/p078.py
fakecoinbase/sweetpandslashAlgorithms
9641e31320f17c6393b7746312c4b030a7faf015
[ "MIT" ]
3
2021-04-21T07:11:33.000Z
2022-01-09T00:05:55.000Z
ProjectEuler/python/p078.py
sweetpand/Algorithms
2e4dcf2d42de25531fae5b4ec0d96ce100043117
[ "MIT" ]
null
null
null
ProjectEuler/python/p078.py
sweetpand/Algorithms
2e4dcf2d42de25531fae5b4ec0d96ce100043117
[ "MIT" ]
null
null
null
# # Solution to Project Euler problem 78 import itertools MODULUS = 10**6 def compute(): partitions = [1] for i in itertools.count(len(partitions)): # We calculate partitions[i] mod 10^6 using a formula based on generalized pentagonal numbers: # partitions(i) = partitions(i - pentagonal(1)) + partitions(...
31.333333
96
0.589362
import itertools MODULUS = 10**6 def compute(): partitions = [1] for i in itertools.count(len(partitions)): item = 0 for j in itertools.count(1): sign = -1 if j % 2 == 0 else +1 index = (j * j * 3 - j) // 2 if index > i: break item += partitions[i - index] * sign ind...
true
true
1c055901c17f1f9cab00de2b9aa8a9c860b0309b
977
py
Python
hwk/hw1/tests/q1.py
Moelf/s19-assignments
035baf9eebb39593936f4ef776974464b880aeb7
[ "MIT" ]
2
2019-04-05T20:35:20.000Z
2019-04-11T10:57:48.000Z
hwk/hw1/tests/q1.py
Moelf/s19-assignments
035baf9eebb39593936f4ef776974464b880aeb7
[ "MIT" ]
null
null
null
hwk/hw1/tests/q1.py
Moelf/s19-assignments
035baf9eebb39593936f4ef776974464b880aeb7
[ "MIT" ]
2
2019-04-05T20:35:23.000Z
2019-04-08T23:03:11.000Z
test = { 'name': 'q1', 'points': 2, 'suites': [ { 'cases': [ { 'code': '>>> ' "all(election_sub['forecast_type'] " '== "classic")\n' 'True', ...
51.421053
83
0.215967
test = { 'name': 'q1', 'points': 2, 'suites': [ { 'cases': [ { 'code': '>>> ' "all(election_sub['forecast_type'] " '== "classic")\n' 'True', ...
true
true
1c055a15d238c6831c494f298543a463ffc725aa
619
py
Python
app/__init__.py
adityadees/python_flask
8029fbc82e8517573d8f0f42c3d36b1f33f3c148
[ "MIT" ]
null
null
null
app/__init__.py
adityadees/python_flask
8029fbc82e8517573d8f0f42c3d36b1f33f3c148
[ "MIT" ]
null
null
null
app/__init__.py
adityadees/python_flask
8029fbc82e8517573d8f0f42c3d36b1f33f3c148
[ "MIT" ]
null
null
null
from flask import Flask from flask_sqlalchemy import SQLAlchemy from config import app_config from flas_login import LoginManager db = SQLAlchemy() login_manager = LoginManager() def create_app(config_name) : app = Flask(__name__, instance_relative_config=True) app.config.from_object(app_config[config_name]) app....
26.913043
74
0.788368
from flask import Flask from flask_sqlalchemy import SQLAlchemy from config import app_config from flas_login import LoginManager db = SQLAlchemy() login_manager = LoginManager() def create_app(config_name) : app = Flask(__name__, instance_relative_config=True) app.config.from_object(app_config[config_name]) app....
false
true
1c055b755783b61c2d86666da4481854bce5c8ab
673
py
Python
Algorithms/4th/01_max_heap.py
endol007/TIL
a86c683149b263aaffffc5f3d22f76d848d829e8
[ "MIT" ]
null
null
null
Algorithms/4th/01_max_heap.py
endol007/TIL
a86c683149b263aaffffc5f3d22f76d848d829e8
[ "MIT" ]
null
null
null
Algorithms/4th/01_max_heap.py
endol007/TIL
a86c683149b263aaffffc5f3d22f76d848d829e8
[ "MIT" ]
null
null
null
class MaxHeap: def __init__(self): self.items = [None] def insert(self, value): self.items.append(value) cur_index = len(self.items) - 1 while cur_index > 1: parent_index = cur_index // 2 if self.items[cur_index] > self.items[parent_index]: ...
26.92
113
0.597325
class MaxHeap: def __init__(self): self.items = [None] def insert(self, value): self.items.append(value) cur_index = len(self.items) - 1 while cur_index > 1: parent_index = cur_index // 2 if self.items[cur_index] > self.items[parent_index]: ...
true
true
1c055c5a030bcc7e0dcd8e0cbc528bf4e29b9307
5,408
py
Python
modules/common/proto/header_pb2.py
jiyongfeng/imap
fcb2205fdc09948936855f87fad75fbf7f821c2b
[ "Apache-2.0" ]
187
2019-11-12T12:43:12.000Z
2022-03-30T01:11:56.000Z
map_label_tool/modules/common/proto/header_pb2.py
dawankafei/OpenHDMap
a89e6d7bf2505e64afd7041b7b5db6ecc7556096
[ "Apache-2.0" ]
13
2021-07-21T07:12:04.000Z
2022-03-30T12:24:48.000Z
map_label_tool/modules/common/proto/header_pb2.py
dawankafei/OpenHDMap
a89e6d7bf2505e64afd7041b7b5db6ecc7556096
[ "Apache-2.0" ]
74
2019-12-30T11:27:05.000Z
2022-03-10T03:22:36.000Z
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: modules/common/proto/header.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import ...
41.922481
567
0.743713
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database from google.p...
true
true
1c055c871e940c976bec285ee16c55826ee1f4a3
1,016
py
Python
setup.py
Adn425/Correlation
20a4beee97dabd2622731ae6faa20829d08c34f9
[ "MIT" ]
null
null
null
setup.py
Adn425/Correlation
20a4beee97dabd2622731ae6faa20829d08c34f9
[ "MIT" ]
null
null
null
setup.py
Adn425/Correlation
20a4beee97dabd2622731ae6faa20829d08c34f9
[ "MIT" ]
null
null
null
import plotly.express as px import csv import numpy as np def plotFigure(data_path): with open(data_path) as csv_file: df = csv.DictReader(csv_file) fig = px.scatter(df,x="Coffee in ml", y="sleep in hours") fig.show() def getDataSource(data_path): marks_in_percentage = [] days_pres...
29.882353
82
0.685039
import plotly.express as px import csv import numpy as np def plotFigure(data_path): with open(data_path) as csv_file: df = csv.DictReader(csv_file) fig = px.scatter(df,x="Coffee in ml", y="sleep in hours") fig.show() def getDataSource(data_path): marks_in_percentage = [] days_pres...
true
true