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 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f74b4f85fc9df182e481bf5e430c56cd3e353fd2 | 301 | py | Python | tests/wd/configs/default/__init__.py | wutiantong/sea | 2f7906c2167efba8b8b04b89009bf04d3922f090 | [
"MIT"
] | 156 | 2017-07-11T03:07:31.000Z | 2022-03-03T18:05:36.000Z | tests/wd/configs/default/__init__.py | wutiantong/sea | 2f7906c2167efba8b8b04b89009bf04d3922f090 | [
"MIT"
] | 203 | 2017-07-10T06:08:21.000Z | 2022-03-23T21:59:04.000Z | tests/wd/configs/default/__init__.py | wutiantong/sea | 2f7906c2167efba8b8b04b89009bf04d3922f090 | [
"MIT"
] | 60 | 2017-07-27T12:25:04.000Z | 2022-01-18T09:04:43.000Z | from .peewee import *
from .async_task import *
CACHE_BACKEND = "Redis"
MIDDLEWARES = [
"sea.middleware.ServiceLogMiddleware",
"sea.middleware.RpcErrorMiddleware",
]
REDIS_HOST = "localhost"
REDIS_PORT = 6379
REDIS_DB = 0
TIMEZONE = "Asia/Shanghai"
GRPC_GRACE = 0
PROMETHEUS_SCRAPE = True
| 16.722222 | 42 | 0.740864 | from .peewee import *
from .async_task import *
CACHE_BACKEND = "Redis"
MIDDLEWARES = [
"sea.middleware.ServiceLogMiddleware",
"sea.middleware.RpcErrorMiddleware",
]
REDIS_HOST = "localhost"
REDIS_PORT = 6379
REDIS_DB = 0
TIMEZONE = "Asia/Shanghai"
GRPC_GRACE = 0
PROMETHEUS_SCRAPE = True
| true | true |
f74b4fd56f4339525a4bd6ec2b28ad0660abcbf4 | 7,713 | py | Python | tests/system/action/motion/test_create_amendment.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | tests/system/action/motion/test_create_amendment.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | 19 | 2021-11-22T16:25:54.000Z | 2021-11-25T13:38:13.000Z | tests/system/action/motion/test_create_amendment.py | MJJojo97/openslides-backend | af0d1edb0070e352d46f285a1ba0bbe3702d49ae | [
"MIT"
] | null | null | null | from tests.system.action.base import BaseActionTestCase
class MotionCreateAmendmentActionTest(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
# create parent motion and workflow
self.set_models(
{
"motion_workflow/12": {
"name":... | 33.534783 | 88 | 0.477376 | from tests.system.action.base import BaseActionTestCase
class MotionCreateAmendmentActionTest(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
self.set_models(
{
"motion_workflow/12": {
"name": "name_workflow1",
... | true | true |
f74b50485cadc66ecf3141f9eda753dcad623336 | 6,693 | py | Python | pyalgotrade/binance/broker.py | metacash-one/pyalgotrade | f9760285b014896e2ef2422adf7268240f6bdee5 | [
"Apache-2.0"
] | 1 | 2018-10-15T04:35:42.000Z | 2018-10-15T04:35:42.000Z | pyalgotrade/binance/broker.py | metacash-one/pyalgotrade | f9760285b014896e2ef2422adf7268240f6bdee5 | [
"Apache-2.0"
] | null | null | null | pyalgotrade/binance/broker.py | metacash-one/pyalgotrade | f9760285b014896e2ef2422adf7268240f6bdee5 | [
"Apache-2.0"
] | null | null | null | # PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 38.912791 | 117 | 0.682504 |
import threading
from datetime import datetime
from .. import bar, broker
from ..bar import TradeBar
from ..broker import backtesting, MarketOrder, FloatTraits
from ..orderbook import OrderBook, Bid, Ask
from . import livebroker
LiveBroker = livebroker.LiveBroker
class BinanceFees(backtesting.... | true | true |
f74b50d1eea18c487d1184d32e76e91eeb1b60c1 | 863 | py | Python | Assignment3/Written/naive_naive_beta.py | CKPalk/MachineLearning | aeb19d72f2d1d56c6e940f57883b13189408aa4c | [
"MIT"
] | null | null | null | Assignment3/Written/naive_naive_beta.py | CKPalk/MachineLearning | aeb19d72f2d1d56c6e940f57883b13189408aa4c | [
"MIT"
] | null | null | null | Assignment3/Written/naive_naive_beta.py | CKPalk/MachineLearning | aeb19d72f2d1d56c6e940f57883b13189408aa4c | [
"MIT"
] | null | null | null | def main():
maximum = 20
for w in range( maximum ):
for x in range( maximum ):
for y in range( maximum ):
for z in range( maximum ):
#print ( w, x, y, z )
positive_Y = float( float(y+z+1)/float(w+x+y+z+2) * ( float(z+1)/float(y+z+2) ) )
negative_Y = float( float(w+x+1)/float(w+x+y+z+2... | 37.521739 | 89 | 0.550406 | def main():
maximum = 20
for w in range( maximum ):
for x in range( maximum ):
for y in range( maximum ):
for z in range( maximum ):
positive_Y = float( float(y+z+1)/float(w+x+y+z+2) * ( float(z+1)/float(y+z+2) ) )
negative_Y = float( float(w+x+1)/float(w+x+y+z+2) * ( float(x+1)/floa... | true | true |
f74b529a7f987d099a7e084ae2958ad73cd8c2b7 | 796 | py | Python | pymatgen/phonon/tests/test_ir_spectra.py | dynikon/pymatgen | 6183f479e30a69bf5b94a0a7e21a3e810b40f02d | [
"MIT"
] | 6 | 2015-02-06T08:27:09.000Z | 2021-02-28T14:42:52.000Z | pymatgen/phonon/tests/test_ir_spectra.py | dynikon/pymatgen | 6183f479e30a69bf5b94a0a7e21a3e810b40f02d | [
"MIT"
] | null | null | null | pymatgen/phonon/tests/test_ir_spectra.py | dynikon/pymatgen | 6183f479e30a69bf5b94a0a7e21a3e810b40f02d | [
"MIT"
] | 3 | 2015-10-21T08:04:40.000Z | 2019-03-19T23:11:15.000Z | from __future__ import unicode_literals
import unittest
import os
from pymatgen.util.testing import PymatgenTest
from monty.serialization import loadfn
test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..",
'test_files')
class IRDielectricTensorTest(PymatgenTest):
def set... | 24.875 | 89 | 0.659548 | from __future__ import unicode_literals
import unittest
import os
from pymatgen.util.testing import PymatgenTest
from monty.serialization import loadfn
test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..",
'test_files')
class IRDielectricTensorTest(PymatgenTest):
def set... | true | true |
f74b52f2cf4f9ec85997cc43e098e38e3e0fada1 | 981 | py | Python | WDJN/bt_beam/data_prepare/get_resp2post.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 21 | 2020-12-16T08:53:38.000Z | 2022-01-21T09:08:55.000Z | WDJN/bt_beam/data_prepare/get_resp2post.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 1 | 2020-12-27T07:56:01.000Z | 2020-12-30T05:13:11.000Z | WDJN/bt_beam/data_prepare/get_resp2post.py | silverriver/Stylized_Dialog | 559dd97c4ec9c91e94deb048f789684ef3f1f9fa | [
"MIT"
] | 1 | 2022-02-28T12:19:19.000Z | 2022-02-28T12:19:19.000Z | import os
from collections import Counter
import copy
dialog_file = 'data/crowded_300k_jinyong_dialog_filter_sort.txt'
prob_file = 'data/crowded_300k_jinyong_dialog_probs_filter_sort.txt'
out_file = 'data/crowded_300k_jinyong_dialog_resp2post_5cand.txt'
n_cand = 5
dialog_data = []
with open(dialog_file) as f:
res... | 25.815789 | 68 | 0.614679 | import os
from collections import Counter
import copy
dialog_file = 'data/crowded_300k_jinyong_dialog_filter_sort.txt'
prob_file = 'data/crowded_300k_jinyong_dialog_probs_filter_sort.txt'
out_file = 'data/crowded_300k_jinyong_dialog_resp2post_5cand.txt'
n_cand = 5
dialog_data = []
with open(dialog_file) as f:
res... | true | true |
f74b5326ede435853f443c0f65388527b0dcf410 | 63,495 | py | Python | av98.py | atbradley/AV-98 | 265a69a6eda3fbad235db1c68edb21add2845a7c | [
"BSD-2-Clause"
] | 1 | 2021-09-22T22:20:10.000Z | 2021-09-22T22:20:10.000Z | av98.py | atbradley/AV-98 | 265a69a6eda3fbad235db1c68edb21add2845a7c | [
"BSD-2-Clause"
] | null | null | null | av98.py | atbradley/AV-98 | 265a69a6eda3fbad235db1c68edb21add2845a7c | [
"BSD-2-Clause"
] | 1 | 2021-09-24T18:49:20.000Z | 2021-09-24T18:49:20.000Z | #!/usr/bin/env python3
# AV-98 Gemini client
# Dervied from VF-1 (https://github.com/solderpunk/VF-1),
# (C) 2019, 2020 Solderpunk <solderpunk@sdf.org>
# With contributions from:
# - danceka <hannu.hartikainen@gmail.com>
# - <jprjr@tilde.club>
# - <vee@vnsf.xyz>
# - Klaus Alexander Seistrup <klaus@seistrup.dk>
# -... | 38.365559 | 141 | 0.563855 |
import argparse
import cmd
import cgi
import codecs
import collections
import datetime
import fnmatch
import getpass
import glob
import hashlib
import io
import mimetypes
import os
import os.path
import random
import shlex
import shutil
import socket
import sqlite3
import ssl
from ssl import CertificateError... | true | true |
f74b5356b6bd58d90e988725ee62a11cb8cd44fc | 538 | py | Python | TwoFactorAuthenticationUser.py | ytyaru/GitHubUser.201704101437 | 611e6c33c9050ae6d65f81cedf769d0f85bd6615 | [
"CC0-1.0"
] | null | null | null | TwoFactorAuthenticationUser.py | ytyaru/GitHubUser.201704101437 | 611e6c33c9050ae6d65f81cedf769d0f85bd6615 | [
"CC0-1.0"
] | null | null | null | TwoFactorAuthenticationUser.py | ytyaru/GitHubUser.201704101437 | 611e6c33c9050ae6d65f81cedf769d0f85bd6615 | [
"CC0-1.0"
] | null | null | null | #!python3
#encoding:utf-8
from abc import ABCMeta, abstractmethod
import AGitHubUser
import BasicAuthenticationUser
class TwoFactorAuthenticationUser(BasicAuthenticationUser.BasicAuthenticationUser):
def __init__(self, username, password, secret):
super().__init__(username, password)
self.__secret =... | 29.888889 | 83 | 0.728625 |
from abc import ABCMeta, abstractmethod
import AGitHubUser
import BasicAuthenticationUser
class TwoFactorAuthenticationUser(BasicAuthenticationUser.BasicAuthenticationUser):
def __init__(self, username, password, secret):
super().__init__(username, password)
self.__secret = secret
def __G... | true | true |
f74b541b4ac3f784ea40e4e292f3d7e0e0e0bbbd | 7,172 | py | Python | src/beanmachine/ppl/legacy/inference/abstract_infer.py | feynmanliang/beanmachine | 5dea2b9f6387f2f7fd1e53b0915a1b8405f2b46b | [
"MIT"
] | null | null | null | src/beanmachine/ppl/legacy/inference/abstract_infer.py | feynmanliang/beanmachine | 5dea2b9f6387f2f7fd1e53b0915a1b8405f2b46b | [
"MIT"
] | null | null | null | src/beanmachine/ppl/legacy/inference/abstract_infer.py | feynmanliang/beanmachine | 5dea2b9f6387f2f7fd1e53b0915a1b8405f2b46b | [
"MIT"
] | 2 | 2022-03-09T06:07:13.000Z | 2022-03-11T05:37:26.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import logging
import platform
import random
from abc import ABCMeta, abstractmethod
from typing import ClassVar, Dict, List
import torch
i... | 34.815534 | 87 | 0.618795 |
import logging
import platform
import random
from abc import ABCMeta, abstractmethod
from typing import ClassVar, Dict, List
import torch
import torch.multiprocessing as mp
from beanmachine.ppl.inference.monte_carlo_samples import MonteCarloSamples
from beanmachine.ppl.inference.utils import (
_verify_queries... | true | true |
f74b5429d36fd8164090c045d7e04836bb2379a3 | 2,224 | py | Python | Chapter25/prototype.py | DeeMATT/AdvancedPythonProgramming | 97091dae4f177fd2c06b20265be2aedf9d1c41e7 | [
"MIT"
] | 55 | 2019-04-12T06:09:02.000Z | 2022-03-10T21:00:48.000Z | Chapter25/prototype.py | DeeMATT/AdvancedPythonProgramming | 97091dae4f177fd2c06b20265be2aedf9d1c41e7 | [
"MIT"
] | null | null | null | Chapter25/prototype.py | DeeMATT/AdvancedPythonProgramming | 97091dae4f177fd2c06b20265be2aedf9d1c41e7 | [
"MIT"
] | 29 | 2019-03-06T08:52:57.000Z | 2022-01-27T15:29:09.000Z | import copy
class Website:
def __init__(self, name, domain, description, author, **kwargs):
'''Examples of optional attributes (kwargs):
category, creation_date, technologies, keywords.
'''
self.name = name
self.domain = domain
self.description = description... | 29.653333 | 79 | 0.5625 | import copy
class Website:
def __init__(self, name, domain, description, author, **kwargs):
self.name = name
self.domain = domain
self.description = description
self.author = author
for key in kwargs:
setattr(self, key, kwargs[key])
def __str__... | true | true |
f74b556d44ab9a283deed604bb8f3e63da2b639d | 418 | py | Python | molecool/atom_data.py | alexvakimov/molecool | 511a56d8562efe08f584d2a76333a6ab742a6622 | [
"BSD-3-Clause"
] | 1 | 2020-03-05T10:13:44.000Z | 2020-03-05T10:13:44.000Z | molecool/atom_data.py | alexvakimov/molecool | 511a56d8562efe08f584d2a76333a6ab742a6622 | [
"BSD-3-Clause"
] | null | null | null | molecool/atom_data.py | alexvakimov/molecool | 511a56d8562efe08f584d2a76333a6ab742a6622 | [
"BSD-3-Clause"
] | null | null | null | """
atom_data.py
Data
stores the essential data
"""
atomic_weights = {
'H': 1.00784,
'C': 12.0107,
'N': 14.0067,
'O': 15.999,
'P': 30.973762,
'F': 18.998403,
'Cl': 35.453,
'Br': 79.904,
}
atom_colors = {
'H': 'white',
'C': '#D3D3D3',
'N': '#add8e6',
'O': 'red',
'... | 13.0625 | 25 | 0.435407 |
atomic_weights = {
'H': 1.00784,
'C': 12.0107,
'N': 14.0067,
'O': 15.999,
'P': 30.973762,
'F': 18.998403,
'Cl': 35.453,
'Br': 79.904,
}
atom_colors = {
'H': 'white',
'C': '#D3D3D3',
'N': '#add8e6',
'O': 'red',
'P': '#FFA500',
'F': '#FFFFE0',
'Cl': '#98FB98'... | true | true |
f74b559ee81810e9e4155751d90f916697b58b82 | 1,056 | py | Python | tests/unit/common/transports/test_common_base_transport.py | CESARBR/opencensus-python | d59ee42037499b25a9307025adeb32ca0681b544 | [
"Apache-2.0"
] | null | null | null | tests/unit/common/transports/test_common_base_transport.py | CESARBR/opencensus-python | d59ee42037499b25a9307025adeb32ca0681b544 | [
"Apache-2.0"
] | null | null | null | tests/unit/common/transports/test_common_base_transport.py | CESARBR/opencensus-python | d59ee42037499b25a9307025adeb32ca0681b544 | [
"Apache-2.0"
] | 1 | 2019-09-01T06:00:13.000Z | 2019-09-01T06:00:13.000Z | # Copyright 2018, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 32 | 74 | 0.731061 |
import unittest
class TestCommonBaseTransport(unittest.TestCase):
def test_export_abstract(self):
from opencensus.common.transports import base
transport = base.Transport()
trace = {}
with self.assertRaises(NotImplementedError):
transport.export(trace)
... | true | true |
f74b561f653e9f54532a0230fd536c879ff9ff0d | 4,104 | py | Python | file_util.py | weiwei11/wind | 4322125ec7c66b33884b0886a98e52afdeda0ec9 | [
"MIT"
] | null | null | null | file_util.py | weiwei11/wind | 4322125ec7c66b33884b0886a98e52afdeda0ec9 | [
"MIT"
] | null | null | null | file_util.py | weiwei11/wind | 4322125ec7c66b33884b0886a98e52afdeda0ec9 | [
"MIT"
] | null | null | null | # @author: ww
import os
import pickle
import re
import yaml
def read_yaml(yaml_file):
"""
Read yaml file
:param yaml_file:
:return:
>>> read_yaml('test_resource/test_read.yml')
{'date': datetime.date(2019, 11, 6), 'pkg': {'python': {'version': '3.6.8', 'date': '{{ date }}'}, 'django': {'ver... | 25.65 | 210 | 0.601365 |
import os
import pickle
import re
import yaml
def read_yaml(yaml_file):
with open(yaml_file) as f:
data_str = f.read()
data = yaml.safe_load(data_str)
return data
def write_yaml(yaml_file, data):
with open(yaml_file, 'w') as f:
yaml.dump(data, f)
def read_pickle(pkl_path):
... | true | true |
f74b56a9228a5e497eabfbb57451945a3d776de5 | 57 | py | Python | hxlti/lti_launch/__init__.py | nmaekawa/hxlti | 6c5b852b8964588a26f8932bd3ec92a7c790b6a0 | [
"BSD-3-Clause"
] | null | null | null | hxlti/lti_launch/__init__.py | nmaekawa/hxlti | 6c5b852b8964588a26f8932bd3ec92a7c790b6a0 | [
"BSD-3-Clause"
] | null | null | null | hxlti/lti_launch/__init__.py | nmaekawa/hxlti | 6c5b852b8964588a26f8932bd3ec92a7c790b6a0 | [
"BSD-3-Clause"
] | null | null | null | """the lti_launch module."""
from . import views # noqa
| 19 | 28 | 0.666667 | from . import views
| true | true |
f74b5792d83fb390a9c2d864540485a0c51d8b17 | 383 | py | Python | ms4/asgi.py | cotebarrientos/4th-milestone-project-your-argentine-shop | 8b098f4a0fea73174b064eacd2b1c53dc1a61bc1 | [
"OLDAP-2.2.1"
] | null | null | null | ms4/asgi.py | cotebarrientos/4th-milestone-project-your-argentine-shop | 8b098f4a0fea73174b064eacd2b1c53dc1a61bc1 | [
"OLDAP-2.2.1"
] | 2 | 2021-04-27T16:04:31.000Z | 2021-05-04T22:02:26.000Z | ms4/asgi.py | cotebarrientos/4th-milestone-project-your-argentine-shop | 8b098f4a0fea73174b064eacd2b1c53dc1a61bc1 | [
"OLDAP-2.2.1"
] | 1 | 2021-06-22T19:50:03.000Z | 2021-06-22T19:50:03.000Z | """
ASGI config for ms4 project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_... | 22.529412 | 78 | 0.780679 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ms4.settings')
application = get_asgi_application()
| true | true |
f74b57d58aa7bda771b18c1a8886677189b878f8 | 22,589 | py | Python | ArchiveTestCode/Red Light Excited Visitor Simulator/LivingArchitectureEnv.py | UWaterloo-ASL/LAS_Gym | 916043d59aeca3deb8875abb280dcecbdcd50f0f | [
"MIT"
] | 1 | 2019-10-26T06:01:57.000Z | 2019-10-26T06:01:57.000Z | ArchiveTestCode/Red Light Excited Visitor Simulator/LivingArchitectureEnv.py | UWaterloo-ASL/LAS_Gym | 916043d59aeca3deb8875abb280dcecbdcd50f0f | [
"MIT"
] | 1 | 2018-05-08T20:28:32.000Z | 2018-05-08T20:28:32.000Z | ArchiveTestCode/Red Light Excited Visitor Simulator/LivingArchitectureEnv.py | UWaterloo-ASL/LAS_Gym | 916043d59aeca3deb8875abb280dcecbdcd50f0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue May 8 16:12:32 2018
@author: jack.lingheng.meng
"""
try:
import vrep
except:
print ('--------------------------------------------------------------')
print ('"vrep.py" could not be imported. This means very probably that')
print ('eithe... | 48.061702 | 187 | 0.608482 |
try:
import vrep
except:
print ('--------------------------------------------------------------')
print ('"vrep.py" could not be imported. This means very probably that')
print ('either "vrep.py" or the remoteApi library could not be found.')
print ('Make sure both are in the same folder as this f... | true | true |
f74b588b819f271ecc6869fb296a83be7b5bedd9 | 4,492 | py | Python | posthog/api/property_definition.py | csmatar/posthog | 4587cfe18625f302726c531f06a32c18e9749e9d | [
"MIT"
] | null | null | null | posthog/api/property_definition.py | csmatar/posthog | 4587cfe18625f302726c531f06a32c18e9749e9d | [
"MIT"
] | 15 | 2021-11-09T10:49:34.000Z | 2021-11-09T16:11:01.000Z | posthog/api/property_definition.py | csmatar/posthog | 4587cfe18625f302726c531f06a32c18e9749e9d | [
"MIT"
] | null | null | null | from typing import Type
from django.db import models
from rest_framework import mixins, permissions, serializers, viewsets
from posthog.api.routing import StructuredViewSetMixin
from posthog.constants import AvailableFeature
from posthog.exceptions import EnterpriseFeatureException
from posthog.filters import TermSea... | 43.192308 | 153 | 0.665405 | from typing import Type
from django.db import models
from rest_framework import mixins, permissions, serializers, viewsets
from posthog.api.routing import StructuredViewSetMixin
from posthog.constants import AvailableFeature
from posthog.exceptions import EnterpriseFeatureException
from posthog.filters import TermSea... | true | true |
f74b5b4d79b4fee293821f60f16da5aad884aebf | 2,730 | py | Python | opcua_plugin/pymodules/pymodbus-tcp/unittest/test.py | intelzhangw2/Converter-for-OPCUA | 70860637798ca94224aec3663d3ea3674a963c5a | [
"Apache-2.0"
] | 64 | 2018-08-30T05:18:54.000Z | 2022-03-23T14:33:42.000Z | opcua_plugin/pymodules/pymodbus-tcp/unittest/test.py | intelzhangw2/Converter-for-OPCUA | 70860637798ca94224aec3663d3ea3674a963c5a | [
"Apache-2.0"
] | null | null | null | opcua_plugin/pymodules/pymodbus-tcp/unittest/test.py | intelzhangw2/Converter-for-OPCUA | 70860637798ca94224aec3663d3ea3674a963c5a | [
"Apache-2.0"
] | 29 | 2018-10-26T06:17:50.000Z | 2021-05-10T07:34:35.000Z | # -*- coding: UTF-8 -*-
# Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 28.14433 | 74 | 0.617216 |
import sys
sys.path.insert(0, '../../../../pyutilities')
from mqservice import MsgQueueService
class Unittest(object):
def __init__(self):
self.queue = 'ModbusPlugin-TCP'
self.mq_serv = MsgQueueService('test_queue')
self.mq_serv.set_callback(self._recv)
self.mq_se... | true | true |
f74b5de87012e43d3e7bc3c183ecb17836a9e94b | 12,976 | py | Python | PELEAnalysis-Processing/Preprocessing/PDBProcessor4PELE.py | SergiR1996/PELEAnalysis-Processing | ad844f14487998eb963186d3b8f314cc9307df28 | [
"MIT"
] | 3 | 2021-02-25T11:56:42.000Z | 2022-02-08T13:23:21.000Z | PELEAnalysis-Processing/Preprocessing/PDBProcessor4PELE.py | SergiR1996/PELEAnalysis-Processing | ad844f14487998eb963186d3b8f314cc9307df28 | [
"MIT"
] | null | null | null | PELEAnalysis-Processing/Preprocessing/PDBProcessor4PELE.py | SergiR1996/PELEAnalysis-Processing | ad844f14487998eb963186d3b8f314cc9307df28 | [
"MIT"
] | 1 | 2022-01-10T15:57:19.000Z | 2022-01-10T15:57:19.000Z | # -*- coding: utf-8 -*-
# Global imports
import os,re
import glob
import argparse as ap
# Local imports
from StorePDBFilenames import *
# Script information
__author__ = "Sergi Rodà"
__license__ = "MIT"
__version__ = "1.0.1"
__maintainer__ = "Sergi Rodà"
__email__ = "sergi.rodallordes@bsc.es"
# Global variables
Pro... | 49.338403 | 193 | 0.574599 |
import os,re
import glob
import argparse as ap
from StorePDBFilenames import *
__author__ = "Sergi Rodà"
__license__ = "MIT"
__version__ = "1.0.1"
__maintainer__ = "Sergi Rodà"
__email__ = "sergi.rodallordes@bsc.es"
Protein_list = ["GLY","ALA","VAL","LEU","ILE","SER","THR","ARG","LYS","PHE","TYR","TRP","ASP","... | true | true |
f74b5f6e5b299c28669c8aea172739178fcdcbc2 | 1,741 | py | Python | src/levitas/middleware/appMiddleware.py | tobi-weber/levitas | b14fb4135839611ace652b9f43cbe5a7fa5e3b66 | [
"Apache-2.0"
] | 1 | 2018-02-27T00:28:29.000Z | 2018-02-27T00:28:29.000Z | src/levitas/middleware/appMiddleware.py | tobi-weber/levitas | b14fb4135839611ace652b9f43cbe5a7fa5e3b66 | [
"Apache-2.0"
] | null | null | null | src/levitas/middleware/appMiddleware.py | tobi-weber/levitas | b14fb4135839611ace652b9f43cbe5a7fa5e3b66 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2010-2014 Tobias Weber <tobi-weber@gmx.de>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 30.54386 | 74 | 0.612866 |
import os
import logging
from .fileMiddleware import FileMiddleware
log = logging.getLogger("levitas.middleware.appMiddleware")
class AppMiddleware(FileMiddleware):
LOG = True
def __init__(self, path, disable_http_caching=False):
FileMiddleware.__init__(self, path)
... | true | true |
f74b5f85b8859834c91df8e50385c90d7329911d | 7,648 | py | Python | kcwidrp/primitives/FluxCalibrate.py | Keck-DataReductionPipelines/KCWI_DRP | 5073a137a8edddf9ff894aef445f877d7186a355 | [
"BSD-3-Clause"
] | 5 | 2020-04-09T20:05:52.000Z | 2021-08-04T18:04:28.000Z | kcwidrp/primitives/FluxCalibrate.py | Keck-DataReductionPipelines/KCWI_DRP | 5073a137a8edddf9ff894aef445f877d7186a355 | [
"BSD-3-Clause"
] | 80 | 2020-03-19T00:35:27.000Z | 2022-03-07T20:08:23.000Z | kcwidrp/primitives/FluxCalibrate.py | Keck-DataReductionPipelines/KCWI_DRP | 5073a137a8edddf9ff894aef445f877d7186a355 | [
"BSD-3-Clause"
] | 9 | 2021-01-22T02:00:32.000Z | 2022-02-08T19:43:16.000Z | from keckdrpframework.primitives.base_primitive import BasePrimitive
from kcwidrp.primitives.kcwi_file_primitives import kcwi_fits_writer, \
kcwi_fits_reader, get_master_name, strip_fname
from kcwidrp.core.kcwi_correct_extin import kcwi_correct_extin
import os
import numpy as np
from scipy.interpolate import inter... | 42.254144 | 81 | 0.528373 | from keckdrpframework.primitives.base_primitive import BasePrimitive
from kcwidrp.primitives.kcwi_file_primitives import kcwi_fits_writer, \
kcwi_fits_reader, get_master_name, strip_fname
from kcwidrp.core.kcwi_correct_extin import kcwi_correct_extin
import os
import numpy as np
from scipy.interpolate import inter... | true | true |
f74b5fbe0c59dcd361a188c982cba1ab8aa266f3 | 1,174 | py | Python | setup.py | kuchel77/pyhealthchecks | bc0c40029031cd248a3951798c1735d48c4d81ab | [
"Apache-2.0"
] | null | null | null | setup.py | kuchel77/pyhealthchecks | bc0c40029031cd248a3951798c1735d48c4d81ab | [
"Apache-2.0"
] | null | null | null | setup.py | kuchel77/pyhealthchecks | bc0c40029031cd248a3951798c1735d48c4d81ab | [
"Apache-2.0"
] | null | null | null | """ Setup for pyHealthchecks """
import os
from setuptools import setup, find_packages
NAME = "pyhealthchecks"
AUTHOR = "Mark Kuchel"
AUTHOR_EMAIL = "mark@kuchel.net"
DESCRIPTION = "An async client library for ping HealthChecks.io"
URL = "https://github.com/kuchel77/pyhealthchecks"
REQUIRES = [
'aiohttp>=3.5.4'
... | 26.681818 | 64 | 0.67632 | import os
from setuptools import setup, find_packages
NAME = "pyhealthchecks"
AUTHOR = "Mark Kuchel"
AUTHOR_EMAIL = "mark@kuchel.net"
DESCRIPTION = "An async client library for ping HealthChecks.io"
URL = "https://github.com/kuchel77/pyhealthchecks"
REQUIRES = [
'aiohttp>=3.5.4'
]
with open("README.md", "r") a... | true | true |
f74b61381caf09ae5485a717f4a0e59c7848f4c6 | 419 | py | Python | Solutions/6-kyu/Eureka/main.py | Reverend-Toady/365-Days-of-Code | 88f699654ab8427d007da8a7ecbf3308952f81e8 | [
"MIT"
] | 1 | 2022-02-11T17:19:29.000Z | 2022-02-11T17:19:29.000Z | Solutions/6-kyu/Eureka/main.py | Reverend-Toady/365-Days-of-Code | 88f699654ab8427d007da8a7ecbf3308952f81e8 | [
"MIT"
] | null | null | null | Solutions/6-kyu/Eureka/main.py | Reverend-Toady/365-Days-of-Code | 88f699654ab8427d007da8a7ecbf3308952f81e8 | [
"MIT"
] | null | null | null | def sum_dig_pow(a, b):
res = []
for i in range(a, b + 1):
temp = []
for idx, elem in enumerate(str(i), start=1):
# print(elem, idx)
# print(int(elem) ** idx)
temp.append(int(elem) ** idx)
# print(temp)
# print(i, sum(temp))
if sum(temp)... | 23.277778 | 52 | 0.472554 | def sum_dig_pow(a, b):
res = []
for i in range(a, b + 1):
temp = []
for idx, elem in enumerate(str(i), start=1):
temp.append(int(elem) ** idx)
if sum(temp) == i:
res.append(i)
return res if res else []
x = sum_dig_... | true | true |
f74b6140204c5d56fa5f872e5e75c62e6ed3b64a | 701 | py | Python | database/models.py | christopherthompson81/fastapi_demo | be6f2486ce810c9574fafb506a153560d1cbcd5e | [
"MIT"
] | 5 | 2019-07-15T21:19:47.000Z | 2021-08-07T16:37:25.000Z | database/models.py | christopherthompson81/fastapi_demo | be6f2486ce810c9574fafb506a153560d1cbcd5e | [
"MIT"
] | null | null | null | database/models.py | christopherthompson81/fastapi_demo | be6f2486ce810c9574fafb506a153560d1cbcd5e | [
"MIT"
] | 1 | 2019-08-29T02:51:38.000Z | 2019-08-29T02:51:38.000Z | '''
FastAPI Demo
SQLAlchemy ORM Models
'''
# Standard Imports
# PyPi Imports
from sqlalchemy import (
Boolean,
Column,
Integer,
String
)
# Local Imports
from database.setup import Base
###############################################################################
class User(Base):
'''ORM Models - users'''
_... | 21.90625 | 79 | 0.661912 |
from sqlalchemy import (
Boolean,
Column,
Integer,
String
)
from database.setup import Base
| true | true |
f74b61915f0a4e900709b2251708bd32e35797e7 | 1,945 | py | Python | main.py | shmouses/EELSpecNet | a9aa085782a08e903e718012d5ce5979c18f7d23 | [
"MIT"
] | 2 | 2021-02-16T19:05:54.000Z | 2022-02-18T04:36:58.000Z | main.py | shmouses/EELSpecNet | a9aa085782a08e903e718012d5ce5979c18f7d23 | [
"MIT"
] | null | null | null | main.py | shmouses/EELSpecNet | a9aa085782a08e903e718012d5ce5979c18f7d23 | [
"MIT"
] | 2 | 2021-07-15T17:33:31.000Z | 2022-03-18T11:48:30.000Z | import EELSpecNet
import GenerateData as gene
import tensorflow as tf
import numpy as np
import tensorflow.experimental.numpy as tnp
tnp.experimental_enable_numpy_behavior()
def main():
model = EELSpecNet.EELSpecNetModel_CNN_10D(2048)
op = tf.keras.optimizers.Adam(learning_rate=5e-5)
model.compile(optimiz... | 43.222222 | 119 | 0.645244 | import EELSpecNet
import GenerateData as gene
import tensorflow as tf
import numpy as np
import tensorflow.experimental.numpy as tnp
tnp.experimental_enable_numpy_behavior()
def main():
model = EELSpecNet.EELSpecNetModel_CNN_10D(2048)
op = tf.keras.optimizers.Adam(learning_rate=5e-5)
model.compile(optimiz... | true | true |
f74b61e7a0de0b7dcff3c3cedc5a09c6e2d9148e | 23,755 | py | Python | pymc/distributions/shape_utils.py | MarcoGorelli/pymc | 140dab0199dfb751951ba99175295c07feb00264 | [
"Apache-2.0"
] | 9 | 2018-07-11T03:10:25.000Z | 2018-07-19T18:59:05.000Z | pymc/distributions/shape_utils.py | MarcoGorelli/pymc | 140dab0199dfb751951ba99175295c07feb00264 | [
"Apache-2.0"
] | 8 | 2020-11-02T17:24:34.000Z | 2021-08-30T18:24:07.000Z | pymc/distributions/shape_utils.py | ricardoV94/pymc | 75ea2a80cb27773e93b7b207043077953940e6ff | [
"Apache-2.0"
] | 1 | 2017-07-18T21:59:15.000Z | 2017-07-18T21:59:15.000Z | # Copyright 2021 The PyMC Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 34.780381 | 143 | 0.619196 |
import warnings
from typing import Optional, Sequence, Tuple, Union
import numpy as np
from aesara.graph.basic import Constant, Variable
from aesara.tensor.var import TensorVariable
from pymc.aesaraf import change_rv_size, pandas_to_array
from pymc.exceptions import ShapeError, ShapeWarning
__all__... | true | true |
f74b6221541098f572b30e117d155e82916feb5d | 5,701 | py | Python | var/spack/repos/builtin/packages/nsimd/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 3 | 2021-09-29T02:14:40.000Z | 2022-01-27T20:50:36.000Z | var/spack/repos/builtin/packages/nsimd/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2022-02-28T11:30:18.000Z | 2022-03-23T19:34:56.000Z | var/spack/repos/builtin/packages/nsimd/package.py | player1537-forks/spack | 822b7632222ec5a91dc7b7cda5fc0e08715bd47c | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class Nsimd(CMakePackage):
"""NSIMD is a vectorization library that abstracts SIMD programming.
It was designed to ... | 42.544776 | 95 | 0.574461 |
class Nsimd(CMakePackage):
homepage = "https://agenium-scale.github.io/nsimd/"
url = "https://github.com/agenium-scale/nsimd/archive/v1.0.tar.gz"
maintainers = ['eschnett']
version('3.0.1', sha256='6a90d7ce5f9da5cfac872463951f3374bb0e0824d92f714db0fd4901b32497fd')
version('3.0', sha256='... | true | true |
f74b62cb11257ff24a6606b1b05c3851c2ceffa4 | 2,523 | py | Python | ontask/dataops/urls.py | pinheiroo27/ontask_b | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | [
"MIT"
] | 33 | 2017-12-02T04:09:24.000Z | 2021-11-07T08:41:57.000Z | ontask/dataops/urls.py | pinheiroo27/ontask_b | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | [
"MIT"
] | 189 | 2017-11-16T04:06:29.000Z | 2022-03-11T23:35:59.000Z | ontask/dataops/urls.py | pinheiroo27/ontask_b | 23fee8caf4e1c5694a710a77f3004ca5d9effeac | [
"MIT"
] | 30 | 2017-11-30T03:35:44.000Z | 2022-01-31T03:08:08.000Z | # -*- coding: utf-8 -*-
"""Views to manipulate dataframes."""
from django.urls import path
from ontask import models
from ontask.dataops import services, views
from ontask.tasks import task_execute_factory
app_name = 'dataops'
urlpatterns = [
# Show the upload merge menu
path('uploadmerge/', views.uploadmerg... | 28.348315 | 79 | 0.689259 |
from django.urls import path
from ontask import models
from ontask.dataops import services, views
from ontask.tasks import task_execute_factory
app_name = 'dataops'
urlpatterns = [
path('uploadmerge/', views.uploadmerge, name='uploadmerge'),
path('plugin_admin/', views.plugin_admin, name='plugin_... | true | true |
f74b634edcb2fc07b8b5f6cae2acd4b51261f5b1 | 2,402 | py | Python | data_/data_save.py | zouguojian/FDN-Learning | ef89cb7d6654d5ac2425621ec6b330652a281f16 | [
"MIT"
] | 1 | 2021-03-24T10:59:27.000Z | 2021-03-24T10:59:27.000Z | data_/data_save.py | zouguojian/FDN-Learning | ef89cb7d6654d5ac2425621ec6b330652a281f16 | [
"MIT"
] | null | null | null | data_/data_save.py | zouguojian/FDN-Learning | ef89cb7d6654d5ac2425621ec6b330652a281f16 | [
"MIT"
] | null | null | null | # -- coding: utf-8 --
import os
import csv
def go_though(open_file):
for root, dirs, files in os.walk(r''+str(open_file)):
for file in files:
# # 获取文件所属目录
# print(root)
# 获取文件路径
print(os.path.join(root, file))
def re_hour(hour):
if len(str(hour))<2:retu... | 31.605263 | 150 | 0.633639 |
import os
import csv
def go_though(open_file):
for root, dirs, files in os.walk(r''+str(open_file)):
for file in files:
print(os.path.join(root, file))
def re_hour(hour):
if len(str(hour))<2:return '0'+str(hour)
else:return str(hour)
def re_month(month):... | true | true |
f74b6494843ca07cb553372ee10336a9aa839bf1 | 1,244 | py | Python | tensorflow_datasets/image/clic_test.py | loganlebanoff/datasets | 44649ac4f8fefdbaae0a66918b03ae7dd8169f1e | [
"Apache-2.0"
] | 2 | 2020-10-12T07:09:38.000Z | 2021-03-05T12:48:23.000Z | tensorflow_datasets/image/clic_test.py | loganlebanoff/datasets | 44649ac4f8fefdbaae0a66918b03ae7dd8169f1e | [
"Apache-2.0"
] | null | null | null | tensorflow_datasets/image/clic_test.py | loganlebanoff/datasets | 44649ac4f8fefdbaae0a66918b03ae7dd8169f1e | [
"Apache-2.0"
] | 1 | 2021-02-20T06:52:51.000Z | 2021-02-20T06:52:51.000Z | # coding=utf-8
# Copyright 2020 The TensorFlow Datasets Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appl... | 27.644444 | 74 | 0.715434 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow_datasets.image import clic
import tensorflow_datasets.public_api as tfds
class ClicTest(tfds.testing.DatasetBuilderTestCase):
DATASET_CLASS = clic.CLIC
SPLITS = {
"tr... | true | true |
f74b64ce8133d98c84536931a67d3bb10744666d | 596 | py | Python | utest/phylib/fieldmap/dat_util.py | frib-high-level-controls/phyhlc | 6486607e3aa0212054a12e9f2ad1a3ef15542f48 | [
"BSD-3-Clause"
] | 1 | 2018-03-22T15:18:54.000Z | 2018-03-22T15:18:54.000Z | utest/phylib/fieldmap/dat_util.py | frib-high-level-controls/phyhlc | 6486607e3aa0212054a12e9f2ad1a3ef15542f48 | [
"BSD-3-Clause"
] | null | null | null | utest/phylib/fieldmap/dat_util.py | frib-high-level-controls/phyhlc | 6486607e3aa0212054a12e9f2ad1a3ef15542f48 | [
"BSD-3-Clause"
] | null | null | null |
import sys, fmdata
"""
Simple script to extract a 'test' data set from a real '.dat' file.
"""
f = open(sys.argv[1], "r")
d = fmdata.readFromDatFile(f)
f.close()
linenums = []
for x in xrange(0, d.nx, 2):
for y in xrange(0, d.ny, 2):
for z in xrange(0, d.nz, 6):
linenums.append(x*d.ny*d.nz +... | 18.625 | 67 | 0.597315 |
import sys, fmdata
f = open(sys.argv[1], "r")
d = fmdata.readFromDatFile(f)
f.close()
linenums = []
for x in xrange(0, d.nx, 2):
for y in xrange(0, d.ny, 2):
for z in xrange(0, d.nz, 6):
linenums.append(x*d.ny*d.nz + y*d.nz + z)
linenums.sort()
f = open(sys.argv[1], "r")
sys.stdout.write(f... | true | true |
f74b6585ed7f496875d97c3e06f161537bd0c575 | 4,115 | py | Python | dataflow/insertDatabaseVolumeChange.py | eliasho/dataflow | 236676619a0490f61d921e6be078593c82503bd2 | [
"MIT"
] | 1 | 2018-05-22T14:46:48.000Z | 2018-05-22T14:46:48.000Z | dataflow/insertDatabaseVolumeChange.py | eliasho/dataflow | 236676619a0490f61d921e6be078593c82503bd2 | [
"MIT"
] | 22 | 2018-05-18T15:28:48.000Z | 2019-09-05T06:19:33.000Z | dataflow/insertDatabaseVolumeChange.py | eliasho/dataflow | 236676619a0490f61d921e6be078593c82503bd2 | [
"MIT"
] | 4 | 2018-07-09T05:08:49.000Z | 2021-03-23T08:19:36.000Z | '''
Created on 11.07.2018
@author: yvo
Main script to import all VAW volume change data files into the GLAMOS database.
'''
import configparser
import os
from dataflow.DataReaders.DatabaseReaders.GlacierReader import GlacierReader
from dataflow.DataObjects.Exceptions.GlacierNotFoundError import GlacierNotFoundError... | 41.989796 | 133 | 0.632807 |
import configparser
import os
from dataflow.DataReaders.DatabaseReaders.GlacierReader import GlacierReader
from dataflow.DataObjects.Exceptions.GlacierNotFoundError import GlacierNotFoundError
from dataflow.DataWriters.DatabaseWriters.VolumeChangeWriter import VolumeChangeWriter
from dataflow.DataReaders.VawFileReade... | true | true |
f74b6661f50f6be8089ef7597752df974ff10d55 | 13,095 | py | Python | pygcam/windows.py | tpike3/pygcam | da0f11e373d4cd99125ce81c5de17d795d8f6d7e | [
"MIT"
] | 18 | 2017-06-15T01:28:46.000Z | 2022-03-30T03:13:35.000Z | pygcam/windows.py | tpike3/pygcam | da0f11e373d4cd99125ce81c5de17d795d8f6d7e | [
"MIT"
] | 8 | 2020-04-03T19:38:14.000Z | 2022-03-03T17:12:17.000Z | pygcam/windows.py | tpike3/pygcam | da0f11e373d4cd99125ce81c5de17d795d8f6d7e | [
"MIT"
] | 10 | 2017-08-13T17:24:03.000Z | 2022-03-06T13:39:25.000Z | '''
.. Stuff specific to MS Windows
.. Copyright (c) 2016 Richard Plevin
See the https://opensource.org/licenses/MIT for license details.
'''
from __future__ import print_function
import os
import platform
from errno import EEXIST
from .config import getParamAsBoolean, unixPath
IsWindows = platform.system() == 'Win... | 39.92378 | 119 | 0.593891 | from __future__ import print_function
import os
import platform
from errno import EEXIST
from .config import getParamAsBoolean, unixPath
IsWindows = platform.system() == 'Windows'
if IsWindows:
import ctypes
import win32file
from pygcam.error import PygcamException
_sopen = ctypes.cdll.msv... | true | true |
f74b668af4721a8183b794a4d69ab5aac2b14f6a | 8,586 | py | Python | xgcm/test/test_metrics_ops_single_axis.py | rcaneill/xgcm-1 | b68a4c70fdb8ade2e7462a958c810a07b0fbcfdb | [
"MIT"
] | null | null | null | xgcm/test/test_metrics_ops_single_axis.py | rcaneill/xgcm-1 | b68a4c70fdb8ade2e7462a958c810a07b0fbcfdb | [
"MIT"
] | null | null | null | xgcm/test/test_metrics_ops_single_axis.py | rcaneill/xgcm-1 | b68a4c70fdb8ade2e7462a958c810a07b0fbcfdb | [
"MIT"
] | null | null | null | from __future__ import print_function
import pytest
import xarray as xr
import numpy as np
from xgcm.grid import Grid, Axis
from xgcm.test.datasets import datasets_grid_metric
@pytest.mark.parametrize("funcname", ["interp", "diff", "min", "max", "cumsum"])
@pytest.mark.parametrize("grid_type", ["B", "C"])
@pytest.ma... | 34.481928 | 104 | 0.593524 | from __future__ import print_function
import pytest
import xarray as xr
import numpy as np
from xgcm.grid import Grid, Axis
from xgcm.test.datasets import datasets_grid_metric
@pytest.mark.parametrize("funcname", ["interp", "diff", "min", "max", "cumsum"])
@pytest.mark.parametrize("grid_type", ["B", "C"])
@pytest.ma... | true | true |
f74b676f8963fe8d51569715661dc3bf4373e0c9 | 3,959 | py | Python | migrations/versions/2018_03_22_user_model_refactor_.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | null | null | null | migrations/versions/2018_03_22_user_model_refactor_.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | null | null | null | migrations/versions/2018_03_22_user_model_refactor_.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | null | null | null | """empty message
Revision ID: 2018_03_22_user_model_refactor
Revises: 2018_03_20_remove_unused_fields
Create Date: 2018-03-22 10:23:42.850491
"""
from alembic import op
import sqlalchemy as sa
from psycopg2._psycopg import ProgrammingError
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql... | 34.426087 | 109 | 0.643849 | from alembic import op
import sqlalchemy as sa
from psycopg2._psycopg import ProgrammingError
from sqlalchemy.dialects import postgresql
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, relationship
revision = '2018_03_22... | true | true |
f74b680d4da3db38dbb655abf00737dca754d83f | 692 | py | Python | tests/test_util.py | TurconiAndrea/recipe-tagger | b5227a2a8a3575ac18b4c47e792353fba8841132 | [
"MIT"
] | 1 | 2021-12-27T17:34:47.000Z | 2021-12-27T17:34:47.000Z | tests/test_util.py | TurconiAndrea/recipe-tagger | b5227a2a8a3575ac18b4c47e792353fba8841132 | [
"MIT"
] | null | null | null | tests/test_util.py | TurconiAndrea/recipe-tagger | b5227a2a8a3575ac18b4c47e792353fba8841132 | [
"MIT"
] | null | null | null | """
Module containg all the tests provided for the util module.
"""
import pytest
from recipe_tagger import util
# @pytest.mark.skip()
def test_process_ingredient():
"""
Test for process_ingredient method.
Test is passed only if the provided ingredient is processed correctly.
"""
assert (
... | 27.68 | 86 | 0.683526 |
import pytest
from recipe_tagger import util
def test_process_ingredient():
assert (
util.process_ingredients("farm eggs without antibiotics", language="en")
== "egg"
)
assert util.process_ingredients("frozen tomatoes", language="en") == "tomato"
assert util.process_ingredients("pom... | true | true |
f74b685d87788090c79eb67021967a419f8e3841 | 1,700 | py | Python | dsne/networks/lenetplus.py | ShownX/d-SNE | 7a8ecdf43d0cbcafae3ad81a60c4eeb21ee228e2 | [
"Apache-2.0"
] | 1 | 2020-03-28T03:34:18.000Z | 2020-03-28T03:34:18.000Z | dsne/networks/lenetplus.py | ShownX/d-SNE | 7a8ecdf43d0cbcafae3ad81a60c4eeb21ee228e2 | [
"Apache-2.0"
] | null | null | null | dsne/networks/lenetplus.py | ShownX/d-SNE | 7a8ecdf43d0cbcafae3ad81a60c4eeb21ee228e2 | [
"Apache-2.0"
] | null | null | null | from mxnet import gluon
def _make_conv_block(block_index, num_chan=32, num_layer=2, stride=1, pad=2):
out = gluon.nn.HybridSequential(prefix='block_%d_' % block_index)
with out.name_scope():
for _ in range(num_layer):
out.add(gluon.nn.Conv2D(num_chan, kernel_size=3, strides=stride, padding... | 32.075472 | 120 | 0.605294 | from mxnet import gluon
def _make_conv_block(block_index, num_chan=32, num_layer=2, stride=1, pad=2):
out = gluon.nn.HybridSequential(prefix='block_%d_' % block_index)
with out.name_scope():
for _ in range(num_layer):
out.add(gluon.nn.Conv2D(num_chan, kernel_size=3, strides=stride, padding... | true | true |
f74b68db1cf2bb337c599a06ded5069a88c49835 | 5,393 | py | Python | xutil/tests/database_test.py | flarco/n1slutil | 2c9f23c2240b4d94507ae799b417060688293979 | [
"MIT"
] | 1 | 2019-07-06T16:01:25.000Z | 2019-07-06T16:01:25.000Z | xutil/tests/database_test.py | flarco/n1slutil | 2c9f23c2240b4d94507ae799b417060688293979 | [
"MIT"
] | null | null | null | xutil/tests/database_test.py | flarco/n1slutil | 2c9f23c2240b4d94507ae799b417060688293979 | [
"MIT"
] | null | null | null | # from parent folder, run 'python -m xutil.tests.helpers_test'
import unittest, os
from path import Path
from unittest.mock import patch
from xutil.helpers import *
from xutil.database.base import get_conn
import docker # https://github.com/docker/docker-py
from collections import namedtuple
class BaseDBTest(unit... | 30.128492 | 115 | 0.643241 |
import unittest, os
from path import Path
from unittest.mock import patch
from xutil.helpers import *
from xutil.database.base import get_conn
import docker
from collections import namedtuple
class BaseDBTest(unittest.TestCase):
timeout = 40
@classmethod
def setUpClass(cls):
cls.client = docker.from_... | true | true |
f74b69dc23f820505fdf9db30768285cd1ba32d8 | 1,337 | py | Python | mmdepth/configs/new_exps/ablations/nyu_swin_large_baseline.py | zhyever/DepthFormer | 5e9b49a48bd1654373e6a4ca3976d4de6f1d6941 | [
"Apache-2.0"
] | 4 | 2022-03-21T01:49:05.000Z | 2022-03-21T12:37:52.000Z | mmdepth/configs/new_exps/ablations/nyu_swin_large_baseline.py | zhyever/DepthFormer | 5e9b49a48bd1654373e6a4ca3976d4de6f1d6941 | [
"Apache-2.0"
] | null | null | null | mmdepth/configs/new_exps/ablations/nyu_swin_large_baseline.py | zhyever/DepthFormer | 5e9b49a48bd1654373e6a4ca3976d4de6f1d6941 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../_base_/models/swin_base.py', '../../_base_/datasets/nyu.py',
'../../_base_/iter_runtime.py', '../../_base_/schedules/schedule_cos24x_iter.py'
]
model = dict(
pretrained='./nfs/checkpoints/swin_large_patch4_window12_384_22k.pth', # noqa
backbone=dict(
pretrain_img_size=384,
... | 28.446809 | 84 | 0.594615 | _base_ = [
'../../_base_/models/swin_base.py', '../../_base_/datasets/nyu.py',
'../../_base_/iter_runtime.py', '../../_base_/schedules/schedule_cos24x_iter.py'
]
model = dict(
pretrained='./nfs/checkpoints/swin_large_patch4_window12_384_22k.pth',
backbone=dict(
pretrain_img_size=384,
e... | true | true |
f74b6a26140bb080c0321482254282099767c644 | 1,677 | py | Python | main.py | PerpetualSmile/Space_Invasion | fefb87f96a297fc27f9435f7d7c17dbad63f9e81 | [
"MIT"
] | 1 | 2020-12-26T12:06:52.000Z | 2020-12-26T12:06:52.000Z | main.py | PerpetualSmile/Space_Invasion | fefb87f96a297fc27f9435f7d7c17dbad63f9e81 | [
"MIT"
] | null | null | null | main.py | PerpetualSmile/Space_Invasion | fefb87f96a297fc27f9435f7d7c17dbad63f9e81 | [
"MIT"
] | 1 | 2019-05-15T02:10:51.000Z | 2019-05-15T02:10:51.000Z | import pygame
from pygame.sprite import Group
from settings import Settings
from ship import Ship
import game_functions as gf
from game_stats import GameStats
from button import Button
from scoreboard import Scoreboard
from mouse_move import MouseMove
from musics import Musics
def run_game():
# 初始化游戏并且创建一个屏幕对象
... | 25.029851 | 121 | 0.699463 | import pygame
from pygame.sprite import Group
from settings import Settings
from ship import Ship
import game_functions as gf
from game_stats import GameStats
from button import Button
from scoreboard import Scoreboard
from mouse_move import MouseMove
from musics import Musics
def run_game():
pygame.init()
... | true | true |
f74b6a598a21da299d70fb28fb84845c2aa477ba | 4,803 | py | Python | lab_2/graphics.py | syth0le/mat_mod_labs | 9c87e771beb75566bb824e34f4520e8b2ca0a4ce | [
"Apache-2.0"
] | null | null | null | lab_2/graphics.py | syth0le/mat_mod_labs | 9c87e771beb75566bb824e34f4520e8b2ca0a4ce | [
"Apache-2.0"
] | null | null | null | lab_2/graphics.py | syth0le/mat_mod_labs | 9c87e771beb75566bb824e34f4520e8b2ca0a4ce | [
"Apache-2.0"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
from scipy import interpolate
from abc import ABCMeta, abstractmethod
from utils.sorting import bubble_sort
class ABSMethods(metaclass=ABCMeta):
def __init__(self, function):
self.function = function
@abstractmethod
def drawGraphic(self, ve... | 27.135593 | 103 | 0.486363 | import numpy as np
from matplotlib import pyplot as plt
from scipy import interpolate
from abc import ABCMeta, abstractmethod
from utils.sorting import bubble_sort
class ABSMethods(metaclass=ABCMeta):
def __init__(self, function):
self.function = function
@abstractmethod
def drawGraphic(self, ve... | true | true |
f74b6aedd7f3e36aed59d665552fdf2b734afe95 | 1,318 | py | Python | plugins/default/metasploit_attacks/metasploit_screengrab_t1113/metasploit_screengrab.py | Thorsten-Sick/PurpleDome | 297d746ef2e17a4207f8274b7fccbe2ce43c4a5f | [
"MIT"
] | 7 | 2021-11-30T19:54:29.000Z | 2022-03-05T23:15:23.000Z | plugins/default/metasploit_attacks/metasploit_screengrab_t1113/metasploit_screengrab.py | Thorsten-Sick/PurpleDome | 297d746ef2e17a4207f8274b7fccbe2ce43c4a5f | [
"MIT"
] | null | null | null | plugins/default/metasploit_attacks/metasploit_screengrab_t1113/metasploit_screengrab.py | Thorsten-Sick/PurpleDome | 297d746ef2e17a4207f8274b7fccbe2ce43c4a5f | [
"MIT"
] | 2 | 2021-11-30T11:16:27.000Z | 2022-02-02T13:36:01.000Z | #!/usr/bin/env python3
# A plugin to nmap targets slow motion, to evade sensors
from plugins.base.attack import AttackPlugin, Requirement
class MetasploitScreengrabPlugin(AttackPlugin):
# Boilerplate
name = "metasploit_screengrab"
description = "Grab a screenshot"
ttp = "T1055"
references = ["h... | 28.652174 | 126 | 0.597876 |
from plugins.base.attack import AttackPlugin, Requirement
class MetasploitScreengrabPlugin(AttackPlugin):
name = "metasploit_screengrab"
description = "Grab a screenshot"
ttp = "T1055"
references = ["https://attack.mitre.org/techniques/T1055/"]
required_files = []
requirements ... | true | true |
f74b6d3b78ca6d294d776870d7952d3a8a53aacc | 1,344 | py | Python | opencensus/stats/stats_recorder.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 650 | 2017-07-09T02:08:10.000Z | 2022-03-22T20:39:54.000Z | opencensus/stats/stats_recorder.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 735 | 2017-07-26T01:15:16.000Z | 2022-03-29T20:17:20.000Z | opencensus/stats/stats_recorder.py | Flared/opencensus-python | e2535e688a50c7a06be8af93ca3b987d387da605 | [
"Apache-2.0"
] | 256 | 2017-07-24T18:29:15.000Z | 2022-03-15T15:33:03.000Z | # Copyright 2018, OpenCensus Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 38.4 | 78 | 0.760417 |
from opencensus.stats import execution_context
from opencensus.stats.measure_to_view_map import MeasureToViewMap
from opencensus.stats.measurement_map import MeasurementMap
class StatsRecorder(object):
def __init__(self):
if execution_context.get_measure_to_view_map() == {}:
exec... | true | true |
f74b6d3f2dee6992c3cfe66625a20766e4ae9a96 | 507 | py | Python | Backend/lib/python3.6/site-packages/flask_mailer/backends/dummy.py | sahilb2/SelfImprovementWebApp | 2ba232c4e150efb4ef41689ed049d29293e2086e | [
"MIT"
] | 1 | 2021-02-24T04:59:03.000Z | 2021-02-24T04:59:03.000Z | Backend/lib/python3.6/site-packages/flask_mailer/backends/dummy.py | sahilb2/SelfImprovementWebApp | 2ba232c4e150efb4ef41689ed049d29293e2086e | [
"MIT"
] | null | null | null | Backend/lib/python3.6/site-packages/flask_mailer/backends/dummy.py | sahilb2/SelfImprovementWebApp | 2ba232c4e150efb4ef41689ed049d29293e2086e | [
"MIT"
] | 1 | 2018-12-09T00:53:21.000Z | 2018-12-09T00:53:21.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from flask_mailer.backends.base import Mailer
class DummyMailer(Mailer):
"""Dummy mailing instance for unittests.
Keeps all sent messages in *oubox* list.
"""
def __init__(self, **kwargs):
self.outbox = []
def send(self, message):
"""Send... | 24.142857 | 54 | 0.625247 |
from flask_mailer.backends.base import Mailer
class DummyMailer(Mailer):
def __init__(self, **kwargs):
self.outbox = []
def send(self, message):
self.outbox.append(message)
def send_quiet(self, message):
self.send(message)
| true | true |
f74b6d59181163c788af4b2a384d46492569c9ee | 4,267 | py | Python | backend/coreapp/sandbox.py | decompme/decomp.me | edb33de278e3fcce59422e0cb18582e805fa766c | [
"MIT"
] | 47 | 2021-11-05T14:20:58.000Z | 2022-03-19T18:56:46.000Z | backend/coreapp/sandbox.py | decompme/decomp.me | edb33de278e3fcce59422e0cb18582e805fa766c | [
"MIT"
] | 131 | 2021-10-20T09:17:16.000Z | 2022-03-31T22:22:54.000Z | backend/coreapp/sandbox.py | decompme/decomp.me | edb33de278e3fcce59422e0cb18582e805fa766c | [
"MIT"
] | 20 | 2021-11-23T18:49:45.000Z | 2022-03-29T06:25:10.000Z | import contextlib
import logging
import os
import shlex
import subprocess
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Dict, List, Optional, Union
from django.conf import settings
from coreapp.error import SandboxError
logger = logging.getLogger(__name__)
class Sandbox(contex... | 32.823077 | 84 | 0.561284 | import contextlib
import logging
import os
import shlex
import subprocess
from pathlib import Path
from tempfile import TemporaryDirectory
from typing import Dict, List, Optional, Union
from django.conf import settings
from coreapp.error import SandboxError
logger = logging.getLogger(__name__)
class Sandbox(contex... | true | true |
f74b6db7bcc9f8d0932e19fd4b7c8be7a3ca0271 | 872 | py | Python | navio_tasks/pure_reports/cli_gitchangelog.py | matthewdeanmartin/random_names | 5c78a96e62c7924864c7ef802f995eb55d5a520f | [
"MIT"
] | 8 | 2019-05-24T19:31:38.000Z | 2019-05-28T14:13:56.000Z | navio_tasks/pure_reports/cli_gitchangelog.py | matthewdeanmartin/random_names | 5c78a96e62c7924864c7ef802f995eb55d5a520f | [
"MIT"
] | 17 | 2018-07-14T17:04:49.000Z | 2022-03-24T15:59:11.000Z | navio_tasks/pure_reports/cli_gitchangelog.py | matthewdeanmartin/so_pip | 0ff7ab096352ae3dc316606d1acd5582cfaee25a | [
"MIT"
] | 2 | 2021-03-26T18:34:41.000Z | 2022-03-14T16:27:23.000Z | """
Extract commit comments from git to a report. Makes for a lousy CHANGELOG.md
"""
import shlex
from navio_tasks.cli_commands import (
check_command_exists,
config_pythonpath,
execute_get_text,
)
from navio_tasks.settings import VENV_SHELL
from navio_tasks.utils import inform
def do_gitchangelog() -> N... | 30.068966 | 85 | 0.712156 | import shlex
from navio_tasks.cli_commands import (
check_command_exists,
config_pythonpath,
execute_get_text,
)
from navio_tasks.settings import VENV_SHELL
from navio_tasks.utils import inform
def do_gitchangelog() -> None:
command_name = "gitchangelog"
check_command_exists(command_name)
... | true | true |
f74b6e59f2fe312e9f7611c775443e330f635f70 | 14,623 | py | Python | Lib/_markupbase.py | jkamdjou/cpython | 6375163c6745315f94d37a99981c05bff444f720 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/_markupbase.py | jkamdjou/cpython | 6375163c6745315f94d37a99981c05bff444f720 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | Lib/_markupbase.py | jkamdjou/cpython | 6375163c6745315f94d37a99981c05bff444f720 | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | """Shared support for scanning document type declarations in HTML and XHTML.
This module is used as a foundation for the html.parser module. It has no
documented public API and should not be used directly.
"""
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.com... | 36.833753 | 92 | 0.479724 |
import re
_declname_match = re.compile(r'[a-zA-Z][-_.a-zA-Z0-9]*\s*').match
_declstringlit_match = re.compile(r'(\'[^\']*\'|"[^"]*")\s*').match
_commentclose = re.compile(r'--\s*>')
_markedsectionclose = re.compile(r']\s*]\s*>')
# An analysis of the MS-Word extensions is available at
# http://www.planetpublish.com/x... | true | true |
f74b705325797d3263bb943daeb46bdb67e49b37 | 3,731 | py | Python | build_docs.py | bitranox/lib_detect_encoding | 95a1325016a645f337943c879ebd34f5a3a630e9 | [
"MIT"
] | null | null | null | build_docs.py | bitranox/lib_detect_encoding | 95a1325016a645f337943c879ebd34f5a3a630e9 | [
"MIT"
] | null | null | null | build_docs.py | bitranox/lib_detect_encoding | 95a1325016a645f337943c879ebd34f5a3a630e9 | [
"MIT"
] | null | null | null | """ Build the README.rst either locally, or on Github for tagged commits.
Usage:
build_docs.py <TRAVIS_REPO_SLUG>
build_docs.py (-h | --help)
The TRAVIS_REPO_SLUG has following Format : "github_username/github_repository"
Options:
-h --help Show this screen
"""
# STDLIB
import datetime
import errno
i... | 35.198113 | 162 | 0.60922 |
import datetime
import errno
import logging
import sys
from typing import Dict
from docopt import docopt
import lib_log_utils
import rst_include
codeclimate_link_hash = "7d130ff52f3b507552ad"
def project_specific(repository_slug: str, repository: str, repository_dashed: st... | true | true |
f74b711d01eec18bff84588a732055b42e890a57 | 21 | py | Python | examples/callable/ex1.py | mcorne/python-by-example | 15339c0909c84b51075587a6a66391100971c033 | [
"MIT"
] | null | null | null | examples/callable/ex1.py | mcorne/python-by-example | 15339c0909c84b51075587a6a66391100971c033 | [
"MIT"
] | null | null | null | examples/callable/ex1.py | mcorne/python-by-example | 15339c0909c84b51075587a6a66391100971c033 | [
"MIT"
] | null | null | null | print(callable(abs))
| 10.5 | 20 | 0.761905 | print(callable(abs))
| true | true |
f74b727bbcd82babe2dac36e1dddbc894fa5cd63 | 1,162 | py | Python | pytorch_gan_metrics/calc_fid_stats.py | w86763777/Pytorch-Unified-FID-IS-Score | 6a2620d6da0faa66bb798aa47c7e0e49ef2032b6 | [
"Apache-2.0"
] | 39 | 2021-06-24T06:09:44.000Z | 2022-03-28T11:57:43.000Z | pytorch_gan_metrics/calc_fid_stats.py | w86763777/Pytorch-Unified-FID-IS-Score | 6a2620d6da0faa66bb798aa47c7e0e49ef2032b6 | [
"Apache-2.0"
] | 2 | 2021-11-18T04:06:09.000Z | 2021-11-19T01:37:24.000Z | pytorch_gan_metrics/calc_fid_stats.py | w86763777/Pytorch-Unified-FID-IS-Score | 6a2620d6da0faa66bb798aa47c7e0e49ef2032b6 | [
"Apache-2.0"
] | 6 | 2021-10-05T01:23:04.000Z | 2021-12-24T05:15:52.000Z | import argparse
import os
import numpy as np
from torch.utils.data import DataLoader
from . import ImageDataset
from .core import get_inception_feature
def calc_and_save_stats(path, output, batch_size):
dataset = ImageDataset(path, exts=['png', 'jpg'])
loader = DataLoader(dataset, batch_size=batch_size, num... | 33.2 | 74 | 0.675559 | import argparse
import os
import numpy as np
from torch.utils.data import DataLoader
from . import ImageDataset
from .core import get_inception_feature
def calc_and_save_stats(path, output, batch_size):
dataset = ImageDataset(path, exts=['png', 'jpg'])
loader = DataLoader(dataset, batch_size=batch_size, num... | true | true |
f74b727bea2b7cb7921276b294d3991a5c008017 | 406 | py | Python | src/prefect/tasks/postgres/__init__.py | BluePoof/prefect | 59dc4eb965ee83bdb1157ee41c9423917d1101ea | [
"Apache-2.0"
] | 1 | 2020-12-07T14:26:50.000Z | 2020-12-07T14:26:50.000Z | src/prefect/tasks/postgres/__init__.py | BluePoof/prefect | 59dc4eb965ee83bdb1157ee41c9423917d1101ea | [
"Apache-2.0"
] | 1 | 2020-05-24T17:04:47.000Z | 2020-05-24T17:04:47.000Z | src/prefect/tasks/postgres/__init__.py | BluePoof/prefect | 59dc4eb965ee83bdb1157ee41c9423917d1101ea | [
"Apache-2.0"
] | null | null | null | """
This module contains a collection of tasks for interacting with Postgres databases via
the psycopg2 library.
"""
try:
from prefect.tasks.postgres.postgres import (
PostgresExecute,
PostgresExecuteMany,
PostgresFetch,
)
except ImportError:
raise ImportError(
'Using `prefe... | 25.375 | 100 | 0.704433 |
try:
from prefect.tasks.postgres.postgres import (
PostgresExecute,
PostgresExecuteMany,
PostgresFetch,
)
except ImportError:
raise ImportError(
'Using `prefect.tasks.postgres` requires Prefect to be installed with the "postgres" extra.'
)
| true | true |
f74b746cfa0beed974e1a973f3f3422ca72fc0c0 | 6,085 | py | Python | tensorflow_probability/python/math/psd_kernels/exponentiated_quadratic.py | NeelGhoshal/probability | 45ed841e3cff6cdc7cd1b2d96dd874d9070318f7 | [
"Apache-2.0"
] | 2 | 2019-10-30T04:45:07.000Z | 2019-10-30T04:45:08.000Z | tensorflow_probability/python/math/psd_kernels/exponentiated_quadratic.py | gregorystrubel/probability | df96f3d56eff92c6b06fbac68dc58e095e28fed6 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/math/psd_kernels/exponentiated_quadratic.py | gregorystrubel/probability | df96f3d56eff92c6b06fbac68dc58e095e28fed6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 39.771242 | 101 | 0.704519 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.internal import assert_util
from tensorflow_probability.python.internal import tensor_util
from tensorflow_probability.python... | true | true |
f74b74c0e567332b00ebed0202ee731f4feca148 | 1,088 | py | Python | InClass&Examples/InClass_20210303.py | jonaswagner2826/MECH6327 | 2b55aaf6f9e1bcf5cc684f5c853cadec26acf9d2 | [
"MIT"
] | null | null | null | InClass&Examples/InClass_20210303.py | jonaswagner2826/MECH6327 | 2b55aaf6f9e1bcf5cc684f5c853cadec26acf9d2 | [
"MIT"
] | null | null | null | InClass&Examples/InClass_20210303.py | jonaswagner2826/MECH6327 | 2b55aaf6f9e1bcf5cc684f5c853cadec26acf9d2 | [
"MIT"
] | null | null | null |
"""
In Class Ex:
Constrained \infty-norm minimization
Problem:
minimize:
\norm{x}_\infty
subject to:
A x \leq b
Notes:
\norm{x}_\infty = \max_i \abs{x_i}
= \max_i \{x_i, -x_i\}
= \max_i \{x_1, \dots, x_n, -x_1, \dots, -x_n\}
Epigraph Form:
mi... | 16.484848 | 67 | 0.52114 |
import cvxpy as cp
import numpy as np
n = 10
m = 100
A = np.random.rand(m, n)
b = np.random.rand(m, 1) - 1
X = cp.Variable((n, n))
prob = cp.Problem(cp.Minimize(cp.max(cp.sum(cp.abs(X)))),
[A @ X <= b])
print("The optimal value is", prob.value)
print("A solution X is")
print(X.value)
| true | true |
f74b75e459f2acec46554a2eb4ee1c0d814b6c3b | 5,096 | py | Python | main/robot.py | edazpotato/usefull-discord-bot | 81b35e73b135afc887033510a635738899793264 | [
"MIT"
] | 2 | 2020-10-16T10:01:18.000Z | 2021-11-15T09:43:34.000Z | main/robot.py | edazpotato/usefull-discord-bot | 81b35e73b135afc887033510a635738899793264 | [
"MIT"
] | null | null | null | main/robot.py | edazpotato/usefull-discord-bot | 81b35e73b135afc887033510a635738899793264 | [
"MIT"
] | null | null | null | import discord
import ksoftapi
import logging
import aiohttp
import os
import json
import datetime
import time
import sys
import asyncpg
from utils import permissions, usefull
from main import context, prefix
from discord.ext import commands
from collections import namedtuple
c = usefull.colors
#AutoShardedClient.sha... | 33.30719 | 194 | 0.700942 | import discord
import ksoftapi
import logging
import aiohttp
import os
import json
import datetime
import time
import sys
import asyncpg
from utils import permissions, usefull
from main import context, prefix
from discord.ext import commands
from collections import namedtuple
c = usefull.colors
class Robot(commands... | true | true |
f74b76264821b75c12d1670e7027915511805e8f | 13,912 | py | Python | disagreements/disagreement.py | yotamitai/Agent-Disagreements | 858583db448c5621273824527f1f4181ebf55a2b | [
"MIT"
] | null | null | null | disagreements/disagreement.py | yotamitai/Agent-Disagreements | 858583db448c5621273824527f1f4181ebf55a2b | [
"MIT"
] | null | null | null | disagreements/disagreement.py | yotamitai/Agent-Disagreements | 858583db448c5621273824527f1f4181ebf55a2b | [
"MIT"
] | null | null | null | from copy import deepcopy
import cv2
import imageio
import numpy as np
import matplotlib.pyplot as plt
from os.path import join
from PIL import ImageFont, ImageDraw, Image
from disagreements.common.utils import make_clean_dirs, save_image, create_video
from disagreements.logging_info import log
from disagreements.get... | 44.165079 | 98 | 0.660006 | from copy import deepcopy
import cv2
import imageio
import numpy as np
import matplotlib.pyplot as plt
from os.path import join
from PIL import ImageFont, ImageDraw, Image
from disagreements.common.utils import make_clean_dirs, save_image, create_video
from disagreements.logging_info import log
from disagreements.get... | true | true |
f74b76339faa97e22e366928d75995088e8ac18e | 1,447 | py | Python | src/kedro_devops/__init__.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | null | null | null | src/kedro_devops/__init__.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | 8 | 2021-10-20T12:32:37.000Z | 2021-10-20T16:46:17.000Z | src/kedro_devops/__init__.py | julianlrcsumz/kedro-devops | 873fbd35a1c47d1b97786e516d70b1b9ece83664 | [
"MIT"
] | 4 | 2021-10-15T13:36:53.000Z | 2021-11-12T16:16:50.000Z | # Copyright 2021 QuantumBlack Visual Analytics Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# THE SOFTWARE IS PROVIDED "AS IS",... | 48.233333 | 77 | 0.77678 |
__version__ = "0.1"
| true | true |
f74b76876d5f0d7432247b78537a960df71bdd33 | 7,678 | py | Python | wechat_formatter/formats.py | STEMgirlsChina/tools | 47936dbd379b1b8580789e50ae95c9e72b77c9ed | [
"Apache-2.0"
] | null | null | null | wechat_formatter/formats.py | STEMgirlsChina/tools | 47936dbd379b1b8580789e50ae95c9e72b77c9ed | [
"Apache-2.0"
] | 1 | 2015-07-05T15:14:41.000Z | 2015-07-05T15:14:41.000Z | wechat_formatter/formats.py | STEMgirlsChina/tools | 47936dbd379b1b8580789e50ae95c9e72b77c9ed | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
__author__ = 'jsun'
class BaseFormat(object):
def __init__(self):
self.name = "base_format"
self.id = -1
self.description = ""
self.html_pre = ""
self.html_post = ""
self.child_formats = []
self.usep = False
self.useheader = False
c... | 44.900585 | 668 | 0.635582 |
__author__ = 'jsun'
class BaseFormat(object):
def __init__(self):
self.name = "base_format"
self.id = -1
self.description = ""
self.html_pre = ""
self.html_post = ""
self.child_formats = []
self.usep = False
self.useheader = False
class SectionTit... | true | true |
f74b769e58ff548e6a248d827fcda649e7136a67 | 405 | py | Python | build/android/pylib/perf/test_options.py | iplo/Chain | 8bc8943d66285d5258fffc41bed7c840516c4422 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | build/android/pylib/perf/test_options.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 8 | 2015-08-31T06:39:59.000Z | 2021-12-04T14:53:28.000Z | build/android/pylib/perf/test_options.py | j4ckfrost/android_external_chromium_org | a1a3dad8b08d1fcf6b6b36c267158ed63217c780 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Defines the PerfOptions named tuple."""
import collections
PerfOptions = collections.namedtuple('PerfOptions', [
'steps',
'flaky_steps',
'pr... | 22.5 | 72 | 0.693827 |
import collections
PerfOptions = collections.namedtuple('PerfOptions', [
'steps',
'flaky_steps',
'print_step',
'no_timeout',
'test_filter',
'dry_run',
'single_step',
])
| true | true |
f74b76a104d2a429f5098d17bffc4e74ab579f88 | 434 | py | Python | Steam Key Safe/venv/Scripts/pip-script.py | baxter5469/steam-key-safe | f9f721fa4776db650956400b1b808f707f07c5c1 | [
"MIT"
] | null | null | null | Steam Key Safe/venv/Scripts/pip-script.py | baxter5469/steam-key-safe | f9f721fa4776db650956400b1b808f707f07c5c1 | [
"MIT"
] | null | null | null | Steam Key Safe/venv/Scripts/pip-script.py | baxter5469/steam-key-safe | f9f721fa4776db650956400b1b808f707f07c5c1 | [
"MIT"
] | null | null | null | #!"C:\Users\IsaacB\Documents\GitHub\steam-key-safe\Steam Key Safe\venv\Scripts\python.exe"
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==9.0.1','console_scripts','pip'
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\... | 33.384615 | 90 | 0.668203 |
__requires__ = 'pip==9.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==9.0.1', 'console_scripts', 'pip')()
)
| true | true |
f74b780a628d5d170fc2ace86b317a9903ac4e69 | 581 | py | Python | podcasts/models.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | null | null | null | podcasts/models.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | null | null | null | podcasts/models.py | abacaxiguy/filosocast | 837e9991641d4d2fa271c7a1de2fa3ffccd46486 | [
"MIT"
] | 1 | 2020-07-03T21:04:34.000Z | 2020-07-03T21:04:34.000Z | from django.db import models
from django.utils import timezone
from autores.models import Autor
class Podcast(models.Model):
titulo = models.CharField(max_length=255)
autor = models.ForeignKey(Autor, on_delete=models.DO_NOTHING)
data = models.DateTimeField(default=timezone.now())
descricao = models.Te... | 32.277778 | 65 | 0.722892 | from django.db import models
from django.utils import timezone
from autores.models import Autor
class Podcast(models.Model):
titulo = models.CharField(max_length=255)
autor = models.ForeignKey(Autor, on_delete=models.DO_NOTHING)
data = models.DateTimeField(default=timezone.now())
descricao = models.Te... | true | true |
f74b7856dbc6047c4de0604367b0229efb740390 | 1,156 | py | Python | src/data_utils.py | mumingpo/590op-final-project | 95851d2f430cdc24b9d834c6a50b069fc637a8ed | [
"MIT"
] | null | null | null | src/data_utils.py | mumingpo/590op-final-project | 95851d2f430cdc24b9d834c6a50b069fc637a8ed | [
"MIT"
] | null | null | null | src/data_utils.py | mumingpo/590op-final-project | 95851d2f430cdc24b9d834c6a50b069fc637a8ed | [
"MIT"
] | null | null | null | import numpy as np
def read_data(path, M, N, offset=0):
"""
Read u.data in the default format.
The memory cost associated with a [943, 1682] matrix of floats are not big,
so we can still do this.
"Might" run into trouble for larger datasets,
where we will need to handle things in batches.
Params:
M:... | 29.641026 | 84 | 0.630623 | import numpy as np
def read_data(path, M, N, offset=0):
arr = np.zeros([M, N], dtype=np.float)
omega = np.full([M, N], False, dtype=np.bool)
with open(path, "rt") as f:
for line in f:
if line == "":
continue
fields = line.split('\t')
if len(fields) != 4:
rais... | true | true |
f74b7913eedf6a298d0a60d29cd4aca38f07b067 | 1,046 | py | Python | backend/api/__init__.py | Idzikowski-Casey/column-topology | da26b10a1c375f31ff39e75fcb3d3d78d142934d | [
"MIT"
] | null | null | null | backend/api/__init__.py | Idzikowski-Casey/column-topology | da26b10a1c375f31ff39e75fcb3d3d78d142934d | [
"MIT"
] | 4 | 2021-12-06T16:47:09.000Z | 2022-01-03T19:34:24.000Z | backend/api/__init__.py | Idzikowski-Casey/column-topology | da26b10a1c375f31ff39e75fcb3d3d78d142934d | [
"MIT"
] | null | null | null | from starlette.routing import Route
from starlette.applications import Starlette
from starlette.middleware.cors import CORSMiddleware
from starlette.middleware import Middleware
from .home import HomePage
from .column_groups import ColumnGroups
from .project import ProjectsAPI
from .geometries import geometries, get_l... | 40.230769 | 94 | 0.710325 | from starlette.routing import Route
from starlette.applications import Starlette
from starlette.middleware.cors import CORSMiddleware
from starlette.middleware import Middleware
from .home import HomePage
from .column_groups import ColumnGroups
from .project import ProjectsAPI
from .geometries import geometries, get_l... | true | true |
f74b79a0c240c21a8083a044a22caf2c46366a36 | 1,916 | py | Python | configs/activations/cascade_r50_4x4_1x.py | kostas1515/GumbelActivationForLLongTailSegmentation | c97a1f6abe02877518de9c266a366ae0fe07d59a | [
"Apache-2.0"
] | 5 | 2021-11-18T17:12:46.000Z | 2021-12-14T16:19:39.000Z | configs/activations/cascade_r50_4x4_1x.py | kostas1515/GumbelActivationForLongTailSegmentation | c97a1f6abe02877518de9c266a366ae0fe07d59a | [
"Apache-2.0"
] | null | null | null | configs/activations/cascade_r50_4x4_1x.py | kostas1515/GumbelActivationForLongTailSegmentation | c97a1f6abe02877518de9c266a366ae0fe07d59a | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../lvis/cascade_rcnn_r50_fpn_sample1e-3_mstrain_1x_lvis_v1.py'
]
data = dict(train=dict(oversample_thr=0.0))
model = dict(roi_head=dict(bbox_head=[dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=1203,
bbox_coder=dict(
... | 34.214286 | 70 | 0.612213 | _base_ = [
'../../lvis/cascade_rcnn_r50_fpn_sample1e-3_mstrain_1x_lvis_v1.py'
]
data = dict(train=dict(oversample_thr=0.0))
model = dict(roi_head=dict(bbox_head=[dict(
type='Shared2FCBBoxHead',
in_channels=256,
fc_out_channels=1024,
roi_feat_size=7,
num_classes=1203,
bbox_coder=dict(
... | true | true |
f74b79b82e1937b79a48e1b43ed66167b97acb17 | 41,245 | py | Python | src/olympia/amo/tests/__init__.py | siddhi523/addons-server | 36ff76a25070c4ef8504837131906a9f2aa8d86a | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/tests/__init__.py | siddhi523/addons-server | 36ff76a25070c4ef8504837131906a9f2aa8d86a | [
"BSD-3-Clause"
] | null | null | null | src/olympia/amo/tests/__init__.py | siddhi523/addons-server | 36ff76a25070c4ef8504837131906a9f2aa8d86a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import random
import shutil
import socket
import struct
import time
import uuid
from contextlib import contextmanager
from datetime import datetime, timedelta
from functools import partial
from importlib import import_module
from urllib.parse import parse_qs, urlparse
from unittest imp... | 34.983036 | 111 | 0.654964 |
import os
import random
import shutil
import socket
import struct
import time
import uuid
from contextlib import contextmanager
from datetime import datetime, timedelta
from functools import partial
from importlib import import_module
from urllib.parse import parse_qs, urlparse
from unittest import mock
from tempfile ... | true | true |
f74b7aefb5c8e941ee78626ce8e15a8860d642cf | 711 | py | Python | addons/account/wizard/account_validate_account_move.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/account/wizard/account_validate_account_move.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/account/wizard/account_validate_account_move.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | from odoo import models, api, _
from odoo.exceptions import UserError
class ValidateAccountMove(models.TransientModel):
_name = "validate.account.move"
_description = "Validate Account Move"
@api.multi
def validate_move(self):
context = dict(self._context or {})
moves = self.env['acco... | 33.857143 | 83 | 0.64135 | from odoo import models, api, _
from odoo.exceptions import UserError
class ValidateAccountMove(models.TransientModel):
_name = "validate.account.move"
_description = "Validate Account Move"
@api.multi
def validate_move(self):
context = dict(self._context or {})
moves = self.env['acco... | true | true |
f74b7d25b7df72482aee056c1dc499900e5c69d7 | 738 | py | Python | tests/mocker/upgrade_workers/error_worker.py | lihaiyong827/python-openimu | f1c536ba4182aaeabd87b63c08ebd92f97e8dbb4 | [
"Apache-2.0"
] | 41 | 2018-07-20T17:30:33.000Z | 2022-02-24T08:17:39.000Z | tests/mocker/upgrade_workers/error_worker.py | lihaiyong827/python-openimu | f1c536ba4182aaeabd87b63c08ebd92f97e8dbb4 | [
"Apache-2.0"
] | 52 | 2018-06-25T22:15:14.000Z | 2022-03-10T07:30:56.000Z | tests/mocker/upgrade_workers/error_worker.py | lihaiyong827/python-openimu | f1c536ba4182aaeabd87b63c08ebd92f97e8dbb4 | [
"Apache-2.0"
] | 31 | 2018-12-19T00:10:08.000Z | 2022-03-19T02:14:03.000Z | from aceinna.devices.base import UpgradeWorkerBase
class ErrorWorker(UpgradeWorkerBase):
def __init__(self):
super(ErrorWorker, self).__init__()
self._total = 1024*1024 # 1M size
def get_upgrade_content_size(self):
return self._total
def work(self):
current = 0
s... | 25.448276 | 66 | 0.577236 | from aceinna.devices.base import UpgradeWorkerBase
class ErrorWorker(UpgradeWorkerBase):
def __init__(self):
super(ErrorWorker, self).__init__()
self._total = 1024*1024
def get_upgrade_content_size(self):
return self._total
def work(self):
current = 0
step = 200... | true | true |
f74b7d8bdd3359e63e7a660bdddcf7d39cf73a1e | 14,752 | py | Python | grakel/kernels/kernel.py | Alessi0X/GraKeL | 222fcdde4071afebeb3d7bd724b1f979ede8df7f | [
"BSD-3-Clause"
] | null | null | null | grakel/kernels/kernel.py | Alessi0X/GraKeL | 222fcdde4071afebeb3d7bd724b1f979ede8df7f | [
"BSD-3-Clause"
] | null | null | null | grakel/kernels/kernel.py | Alessi0X/GraKeL | 222fcdde4071afebeb3d7bd724b1f979ede8df7f | [
"BSD-3-Clause"
] | null | null | null | """The main class file representing a kernel."""
# Author: Ioannis Siglidis <y.siglidis@gmail.com>
# License: BSD 3 clause
import collections
import warnings
import copy
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
from sklearn.exceptions import NotFittedError
fr... | 34.629108 | 100 | 0.564466 |
import collections
import warnings
import copy
import numpy as np
from sklearn.base import BaseEstimator
from sklearn.base import TransformerMixin
from sklearn.exceptions import NotFittedError
from sklearn.utils.validation import check_is_fitted
from sklearn.externals import joblib
from grakel.graph import Graph
f... | true | true |
f74b7e44a3b8656f186f8930530770ad7bef80e6 | 64,587 | py | Python | conans/test/unittests/client/build/cmake_test.py | akemimadoka/conan | 272be061082ddf73f1f5d71bf98f50273d7f3cba | [
"MIT"
] | null | null | null | conans/test/unittests/client/build/cmake_test.py | akemimadoka/conan | 272be061082ddf73f1f5d71bf98f50273d7f3cba | [
"MIT"
] | null | null | null | conans/test/unittests/client/build/cmake_test.py | akemimadoka/conan | 272be061082ddf73f1f5d71bf98f50273d7f3cba | [
"MIT"
] | null | null | null | import os
import platform
import shutil
import stat
import sys
import unittest
import mock
import six
from parameterized.parameterized import parameterized
from conans.client import tools
from conans.client.build.cmake import CMake
from conans.client.build.cmake_flags import cmake_in_local_cache_var_name
from conans.... | 44.820958 | 101 | 0.588416 | import os
import platform
import shutil
import stat
import sys
import unittest
import mock
import six
from parameterized.parameterized import parameterized
from conans.client import tools
from conans.client.build.cmake import CMake
from conans.client.build.cmake_flags import cmake_in_local_cache_var_name
from conans.... | true | true |
f74b7e8a3f2617ff3221d387fc11642c755c9911 | 1,375 | py | Python | examples/onedrive/import_files.py | andreas-j-hauser/Office365-REST-Python-Client | 4bf8ee0b65985980b50fc3b74b32fd2db34561ba | [
"MIT"
] | null | null | null | examples/onedrive/import_files.py | andreas-j-hauser/Office365-REST-Python-Client | 4bf8ee0b65985980b50fc3b74b32fd2db34561ba | [
"MIT"
] | null | null | null | examples/onedrive/import_files.py | andreas-j-hauser/Office365-REST-Python-Client | 4bf8ee0b65985980b50fc3b74b32fd2db34561ba | [
"MIT"
] | null | null | null | import os
from os.path import isfile, join
import adal
from settings import settings
from office365.graph_client import GraphClient
def get_token():
"""Acquire token via client credential flow
"""
authority_url = 'https://login.microsoftonline.com/{0}'.format(settings['tenant'])
auth_ctx = adal.Auth... | 31.25 | 93 | 0.705455 | import os
from os.path import isfile, join
import adal
from settings import settings
from office365.graph_client import GraphClient
def get_token():
authority_url = 'https://login.microsoftonline.com/{0}'.format(settings['tenant'])
auth_ctx = adal.AuthenticationContext(authority_url)
token = auth_ctx.ac... | true | true |
f74b7f5ce34cab20dbc06453c8fd0761ad5cd3c5 | 6,705 | py | Python | LYDIAN/lydian/traffic/task.py | AJBenjumea/distributed-apps-platform | 3a4e01099659622b5d7ec1cd0772c1ed309534dd | [
"BSD-2-Clause"
] | 8 | 2021-08-09T03:42:25.000Z | 2022-03-22T15:40:13.000Z | LYDIAN/lydian/traffic/task.py | AJBenjumea/distributed-apps-platform | 3a4e01099659622b5d7ec1cd0772c1ed309534dd | [
"BSD-2-Clause"
] | 2 | 2021-08-05T15:05:47.000Z | 2021-08-09T18:20:23.000Z | LYDIAN/lydian/traffic/task.py | AJBenjumea/distributed-apps-platform | 3a4e01099659622b5d7ec1cd0772c1ed309534dd | [
"BSD-2-Clause"
] | 19 | 2021-07-13T02:28:18.000Z | 2022-03-23T03:57:39.000Z | #!/usr/bin/env python
# Copyright (c) 2020-2021 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2 License
# The full license information can be found in LICENSE.txt
# in the root directory of this project.
import logging
import os
import queue
import threading
from lydian.apps import config as config... | 32.08134 | 77 | 0.61223 |
import logging
import os
import queue
import threading
from lydian.apps import config as config
from lydian.traffic.core import TrafficRecord
from lydian.traffic.client import TCPClient, UDPClient, HTTPClient
from lydian.traffic.server import TCPServer, UDPServer, HTTPServer
from lydian.utils.common import is_ip... | true | true |
f74b7fe189d63be3f9241fc1c4b06e4682fffcce | 1,861 | py | Python | data_preprocess.py | atharvamh/Predicting-IDC-in-Breast-Cancer | b9b4dff53256042947749c0ad0ba0536e9984a5a | [
"MIT"
] | null | null | null | data_preprocess.py | atharvamh/Predicting-IDC-in-Breast-Cancer | b9b4dff53256042947749c0ad0ba0536e9984a5a | [
"MIT"
] | null | null | null | data_preprocess.py | atharvamh/Predicting-IDC-in-Breast-Cancer | b9b4dff53256042947749c0ad0ba0536e9984a5a | [
"MIT"
] | null | null | null | import os
import numpy as np
import pandas as pd
import cv2
import matplotlib.pyplot as plt
import fnmatch
from sklearn.model_selection import train_test_split
from glob import glob
imagePatches = glob('./IDC_regular_ps50_idx5/**/*.png',recursive = True)
def multiplot():
plt.rcParams['figure.figsize'] = (10.0, 10.... | 25.493151 | 81 | 0.679742 | import os
import numpy as np
import pandas as pd
import cv2
import matplotlib.pyplot as plt
import fnmatch
from sklearn.model_selection import train_test_split
from glob import glob
imagePatches = glob('./IDC_regular_ps50_idx5/**/*.png',recursive = True)
def multiplot():
plt.rcParams['figure.figsize'] = (10.0, 10.... | true | true |
f74b809977f75926bc57ff9c2d3663d1e6038e1a | 5,602 | py | Python | tests/toranj/test-002-form.py | tpmanley/openthread | bc02c6c05cf52884bc6cd9fad8dc8fc16364a147 | [
"BSD-3-Clause"
] | null | null | null | tests/toranj/test-002-form.py | tpmanley/openthread | bc02c6c05cf52884bc6cd9fad8dc8fc16364a147 | [
"BSD-3-Clause"
] | 2 | 2019-02-25T10:21:34.000Z | 2022-01-23T13:05:08.000Z | tests/toranj/test-002-form.py | tpmanley/openthread | bc02c6c05cf52884bc6cd9fad8dc8fc16364a147 | [
"BSD-3-Clause"
] | 1 | 2020-10-22T16:33:36.000Z | 2020-10-22T16:33:36.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2018, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 38.108844 | 121 | 0.673152 |
from wpan import verify
import wpan
test_name = __file__[:-3] if __file__.endswith('.py') else __file__
print('-' * 120)
print('Starting \'{}\''.format(test_name))
speedup = 4
wpan.Node.set_time_speedup_factor(speedup)
node = wpan.Node()
wpan.Node.init_all_nodes()
DEFAULT_K... | true | true |
f74b81037be83ae7ee405b51f6737b40ceb936cb | 555 | py | Python | regexlib/2021-5-15/python_re2_test_file/regexlib_3613.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | 1 | 2022-01-24T14:43:23.000Z | 2022-01-24T14:43:23.000Z | regexlib/2021-5-15/python_re2_test_file/regexlib_3613.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | regexlib/2021-5-15/python_re2_test_file/regexlib_3613.py | yetingli/ReDoS-Benchmarks | f5b5094d835649e957bf3fec6b8bd4f6efdb35fc | [
"MIT"
] | null | null | null | # 3613
# <(?<tag>\w*|\w*\.+\w*)>+((.|[\n\t\f\r\s])*?)<\/\k<tag>>
# EXPONENT
# nums:5
# EXPONENT AttackString:"<>"+"\t\t"*16+"! _1_EOD(i2)"
import re2 as re
from time import perf_counter
regex = """<(?<tag>\w*|\w*\.+\w*)>+((.|[\n\t\f\r\s])*?)<\/\k<tag>>"""
REGEX = re.compile(regex)
for i in range(0, 150000):
ATTAC... | 29.210526 | 69 | 0.52973 |
import re2 as re
from time import perf_counter
regex = """<(?<tag>\w*|\w*\.+\w*)>+((.|[\n\t\f\r\s])*?)<\/\k<tag>>"""
REGEX = re.compile(regex)
for i in range(0, 150000):
ATTACK = "<>" + "\t\t" * i * 1 + "! _1_EOD(i2)"
LEN = len(ATTACK)
BEGIN = perf_counter()
m = REGEX.search(ATTACK)
DURA... | true | true |
f74b81141dde7bbe764d03a5dd014712d26d6c61 | 6,925 | py | Python | library/dokku_config.py | weirdaze/ansible-dokku | e2f5a4d93ae124e7f4b1f9ac8d47e3e4ad34e798 | [
"MIT"
] | null | null | null | library/dokku_config.py | weirdaze/ansible-dokku | e2f5a4d93ae124e7f4b1f9ac8d47e3e4ad34e798 | [
"MIT"
] | null | null | null | library/dokku_config.py | weirdaze/ansible-dokku | e2f5a4d93ae124e7f4b1f9ac8d47e3e4ad34e798 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# from ansible.module_utils.basic import *
from ansible.module_utils.basic import AnsibleModule
import json
import pipes
import subprocess
import logging
try:
basestring
except NameError:
basestring = str
DOCUMENTATION = '''
---
module: dokku_config
short_description... | 28.265306 | 149 | 0.598556 |
from ansible.module_utils.basic import AnsibleModule
import json
import pipes
import subprocess
import logging
try:
basestring
except NameError:
basestring = str
DOCUMENTATION = '''
---
module: dokku_config
short_description: Manage environment variables for a given dokku application
options:
app:
d... | true | true |
f74b8115b43ea54d3538891ea230e9418ba43a9e | 1,757 | py | Python | notes/algo-ds-practice/problems/array/smallest_not_subset_sum.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 6 | 2020-07-05T05:15:19.000Z | 2021-01-24T20:17:14.000Z | notes/algo-ds-practice/problems/array/smallest_not_subset_sum.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | null | null | null | notes/algo-ds-practice/problems/array/smallest_not_subset_sum.py | Anmol-Singh-Jaggi/interview-notes | 65af75e2b5725894fa5e13bb5cd9ecf152a0d652 | [
"MIT"
] | 2 | 2020-09-14T06:46:37.000Z | 2021-06-15T09:17:21.000Z | """
Given a sorted array (sorted in non-decreasing order) of positive numbers, find the smallest positive integer value that cannot be represented as sum of elements of any subset of given set.
Expected time complexity is O(n).
Examples:
Input: arr[] = {1, 3, 6, 10, 11, 15};
Output: 2
Input: arr[] = {1, 1, 1, 1};
... | 32.537037 | 298 | 0.671599 |
def smallest_not_subset_sum(arr):
if arr[0] > 1:
return 1
largest_possible = 1
for i in range(1, len(arr)):
elem = arr[i]
if elem > largest_possible + 1:
break
largest_possible += elem
return largest_possible + 1
def main():
arr = [5]
ans = sm... | true | true |
f74b81e5299010241285001819e54aa604a06130 | 858 | py | Python | molecool/io/xyz.py | BBarrow31500/molssi-best-practices | 737d46aaab087bb9d5c45d2d76bc6f2e879fa060 | [
"BSD-3-Clause"
] | null | null | null | molecool/io/xyz.py | BBarrow31500/molssi-best-practices | 737d46aaab087bb9d5c45d2d76bc6f2e879fa060 | [
"BSD-3-Clause"
] | null | null | null | molecool/io/xyz.py | BBarrow31500/molssi-best-practices | 737d46aaab087bb9d5c45d2d76bc6f2e879fa060 | [
"BSD-3-Clause"
] | null | null | null | """
This module reads and writes xyz files.
"""
import os
import numpy as np
def open_xyz(file_location):
# Open an xyz file and return symbols and coordinates.
xyz_file = np.genfromtxt(fname=file_location, skip_header=2, dtype='unicode')
symbols = xyz_file[:,0]
coords = (xyz_file[:,1:])
coor... | 29.586207 | 100 | 0.60373 |
import os
import numpy as np
def open_xyz(file_location):
xyz_file = np.genfromtxt(fname=file_location, skip_header=2, dtype='unicode')
symbols = xyz_file[:,0]
coords = (xyz_file[:,1:])
coords = coords.astype(np.float)
return symbols, coords
def write_xyz(file_location, symbols, coordin... | true | true |
f74b82c65b889d59f29bb69b10c44b4182a72054 | 269 | py | Python | cougar/common/loads.py | Swall0w/cougar | 9161b2b1d0c256f4bb952ec190351684f28ec1b7 | [
"MIT"
] | 1 | 2019-11-23T12:20:50.000Z | 2019-11-23T12:20:50.000Z | cougar/common/loads.py | Swall0w/cougar | 9161b2b1d0c256f4bb952ec190351684f28ec1b7 | [
"MIT"
] | 1 | 2022-01-13T01:41:34.000Z | 2022-01-13T01:41:34.000Z | cougar/common/loads.py | Swall0w/cougar | 9161b2b1d0c256f4bb952ec190351684f28ec1b7 | [
"MIT"
] | null | null | null | import hjson
def read_config(filename: str) -> dict:
with open(filename, 'r') as f:
ret = f.read()
return hjson.loads(ret)
def read_labels(filename: str) -> list:
with open(filename) as f:
lines = f.read().splitlines()
return lines
| 17.933333 | 39 | 0.6171 | import hjson
def read_config(filename: str) -> dict:
with open(filename, 'r') as f:
ret = f.read()
return hjson.loads(ret)
def read_labels(filename: str) -> list:
with open(filename) as f:
lines = f.read().splitlines()
return lines
| true | true |
f74b8360107b60a2cd2fbf3da2dedeaae5a912e4 | 391 | py | Python | Spardha/Spardha/wsgi.py | atharvabhatt200/Spardha21-Backend | a88233df8874354b2d38e8620342c6ab0011bc6f | [
"MIT"
] | null | null | null | Spardha/Spardha/wsgi.py | atharvabhatt200/Spardha21-Backend | a88233df8874354b2d38e8620342c6ab0011bc6f | [
"MIT"
] | 9 | 2022-03-03T07:41:38.000Z | 2022-03-19T14:40:41.000Z | Spardha/Spardha/wsgi.py | atharvabhatt200/Spardha21-Backend | a88233df8874354b2d38e8620342c6ab0011bc6f | [
"MIT"
] | 1 | 2022-03-02T21:23:03.000Z | 2022-03-02T21:23:03.000Z | """
WSGI config for Spardha project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Spardha.settings')
application = get_wsgi_application()
| true | true |
f74b847e172ac2cdc91315fa034599600eeeb726 | 31,942 | py | Python | lte/gateway/python/magma/pipelined/app/enforcement_stats.py | TatvamasiLabs/magma | 045ff1d142009bf172c24f53e15acb526429a346 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/pipelined/app/enforcement_stats.py | TatvamasiLabs/magma | 045ff1d142009bf172c24f53e15acb526429a346 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/pipelined/app/enforcement_stats.py | TatvamasiLabs/magma | 045ff1d142009bf172c24f53e15acb526429a346 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 36.256527 | 125 | 0.602123 | import ipaddress
import os
from collections import defaultdict, namedtuple
from datetime import datetime, timedelta
from subprocess import check_output
import ryu.app.ofctl.api as ofctl_api
from lte.protos.pipelined_pb2 import RuleModResult
from lte.protos.policydb_pb2 import FlowDescription
from lte.protos.session_ma... | true | true |
f74b851a0072943b5bd5adef5401ea1d1b9e5de5 | 4,452 | py | Python | NaturalLanguageProcessingWithPython/05/practice37.py | t2y/learnnlp | b3c42413deaf5e70c7e7e1ee6d08c9dec114e85e | [
"Artistic-2.0"
] | 4 | 2015-09-19T02:51:06.000Z | 2016-08-18T13:18:49.000Z | NaturalLanguageProcessingWithPython/05/practice37.py | t2y/learnnlp | b3c42413deaf5e70c7e7e1ee6d08c9dec114e85e | [
"Artistic-2.0"
] | null | null | null | NaturalLanguageProcessingWithPython/05/practice37.py | t2y/learnnlp | b3c42413deaf5e70c7e7e1ee6d08c9dec114e85e | [
"Artistic-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
from pprint import pprint
from nltk import NgramTagger
from nltk import jsontags
from nltk.corpus import brown
import nltk
"""
5 章 単語の分類とタグ付け
37. 1つ前のタグ情報を利用するデフォルトタガーを作る
'I like to blog on Kim's blog' の blog にどうやってタグを付けるか?
a. 1つ前の単語を調べるが、現在の単語は無視... | 33.223881 | 66 | 0.645777 |
from __future__ import print_function
from pprint import pprint
from nltk import NgramTagger
from nltk import jsontags
from nltk.corpus import brown
import nltk
@jsontags.register_tag
class PreviousTagTagger(NgramTagger):
json_tag = 'nltk.tag.sequential.PreviousTagTagger'
def __init__(self, train=None,... | true | true |
f74b86e67f6430d37ee2c7f55a9b629a172e493f | 3,158 | py | Python | pgAdmin/pgadmin4/tools/copyright_updater.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/tools/copyright_updater.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | pgAdmin/pgadmin4/tools/copyright_updater.py | WeilerWebServices/PostgreSQL | ae594ed077bebbad1be3c1d95c38b7c2c2683e8c | [
"PostgreSQL"
] | null | null | null | # -*- coding: utf-8 -*-
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2020, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
####################################################################... | 30.365385 | 79 | 0.542749 | true | true | |
f74b8742b523ab4e459cece29dc0bef34dcb9103 | 7,138 | py | Python | sdk/lusid/models/aggregation_options.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | sdk/lusid/models/aggregation_options.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | sdk/lusid/models/aggregation_options.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3725
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 40.327684 | 312 | 0.669936 |
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getfullargspec
import pprint
import re
import six
from lusid.configuration import Configuration
class AggregationOptions(object):
openapi_types = {
'use_ansi_like_syntax': 'bool',
'allow_p... | true | true |
f74b87c2e348557b7516c97c5393d280bb8ef3d4 | 363 | py | Python | onlinecourse/migrations/0002_auto_20210620_0230.py | Krishpandya682/IBMFullStackDjango | 4a1f181d2ee309a1c040c1e51e49b4fccd558d08 | [
"Apache-2.0"
] | null | null | null | onlinecourse/migrations/0002_auto_20210620_0230.py | Krishpandya682/IBMFullStackDjango | 4a1f181d2ee309a1c040c1e51e49b4fccd558d08 | [
"Apache-2.0"
] | null | null | null | onlinecourse/migrations/0002_auto_20210620_0230.py | Krishpandya682/IBMFullStackDjango | 4a1f181d2ee309a1c040c1e51e49b4fccd558d08 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.3 on 2021-06-19 21:00
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('onlinecourse', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='submission',
old_name='chocies',
... | 19.105263 | 47 | 0.584022 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('onlinecourse', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='submission',
old_name='chocies',
new_name='choices',
),
]
| true | true |
f74b883dc11e23e3931c0be0f84e6c49c5b4d5c0 | 416 | py | Python | cython_setup.py | paroj/async-ev-cnn | f7e70e75b07f43afef8ffd7eaf6f43ddefab0ae0 | [
"MIT"
] | 6 | 2021-03-04T07:44:10.000Z | 2022-02-28T14:49:53.000Z | cython_setup.py | paroj/async-ev-cnn | f7e70e75b07f43afef8ffd7eaf6f43ddefab0ae0 | [
"MIT"
] | 1 | 2022-03-10T02:12:31.000Z | 2022-03-10T02:12:31.000Z | cython_setup.py | paroj/async-ev-cnn | f7e70e75b07f43afef8ffd7eaf6f43ddefab0ae0 | [
"MIT"
] | 4 | 2021-07-27T06:11:33.000Z | 2022-03-25T03:32:44.000Z | from sys import platform
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy
ext_modules = [
Extension(
"src.libs.cutils",
["src/libs/cutils.pyx"],
extra_compile_args=['/openmp' if platform == "win32" else '-fopenmp']
... | 21.894737 | 77 | 0.697115 | from sys import platform
from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
import numpy
ext_modules = [
Extension(
"src.libs.cutils",
["src/libs/cutils.pyx"],
extra_compile_args=['/openmp' if platform == "win32" else '-fopenmp']
... | true | true |
f74b88b217b3e7ef06d815c294ed0f2c523f74ed | 3,362 | py | Python | tableauserverclient/server/endpoint/auth_endpoint.py | rrobertsrgare/server-client-python | 3f4db45584fb352e9f21c870027a2302cb824909 | [
"CC0-1.0",
"MIT"
] | null | null | null | tableauserverclient/server/endpoint/auth_endpoint.py | rrobertsrgare/server-client-python | 3f4db45584fb352e9f21c870027a2302cb824909 | [
"CC0-1.0",
"MIT"
] | null | null | null | tableauserverclient/server/endpoint/auth_endpoint.py | rrobertsrgare/server-client-python | 3f4db45584fb352e9f21c870027a2302cb824909 | [
"CC0-1.0",
"MIT"
] | null | null | null | from ..request_factory import RequestFactory
from .exceptions import ServerResponseError
from .endpoint import Endpoint, api
import xml.etree.ElementTree as ET
import logging
logger = logging.getLogger('tableau.endpoint.auth')
class Auth(Endpoint):
class contextmgr(object):
def __init__(self, callback):
... | 44.236842 | 115 | 0.663891 | from ..request_factory import RequestFactory
from .exceptions import ServerResponseError
from .endpoint import Endpoint, api
import xml.etree.ElementTree as ET
import logging
logger = logging.getLogger('tableau.endpoint.auth')
class Auth(Endpoint):
class contextmgr(object):
def __init__(self, callback):
... | true | true |
f74b88d8c4ccbe1c94598053a1c2779a2ebc71d0 | 1,907 | py | Python | v2/user.py | Llf0703/Anti-Cheating | 01c49feaf5d094fa09efd91f7181e027601f1c57 | [
"MIT"
] | 5 | 2018-12-27T05:15:11.000Z | 2020-02-29T10:57:57.000Z | v2/user.py | Llf0703/Anti-Cheating | 01c49feaf5d094fa09efd91f7181e027601f1c57 | [
"MIT"
] | 1 | 2019-01-06T07:05:29.000Z | 2019-01-06T07:05:29.000Z | v2/user.py | Llf0703/Anti-Cheating | 01c49feaf5d094fa09efd91f7181e027601f1c57 | [
"MIT"
] | 2 | 2019-01-06T07:01:16.000Z | 2019-12-24T03:26:48.000Z | # 下载选手代码
import re
import os
from ac.pre import get_yaml
from ac.pre import get_html
from selenium import webdriver
from urllib.request import quote
from selenium.webdriver.firefox.options import Options
config = get_yaml()
contest_url = str(config['oj_url'])+'/contest/'+str(config['contest_id'])
options = Options(... | 30.758065 | 122 | 0.5742 |
import re
import os
from ac.pre import get_yaml
from ac.pre import get_html
from selenium import webdriver
from urllib.request import quote
from selenium.webdriver.firefox.options import Options
config = get_yaml()
contest_url = str(config['oj_url'])+'/contest/'+str(config['contest_id'])
options = Options()
option... | true | true |
f74b88de7259886dce8007d75b04160be6cc2606 | 3,123 | py | Python | aula_ORM/aula_ORM/settings.py | dfvalle/project-si7 | a206cc1f34ec2e80432fc0275e4931270212776a | [
"Apache-2.0"
] | null | null | null | aula_ORM/aula_ORM/settings.py | dfvalle/project-si7 | a206cc1f34ec2e80432fc0275e4931270212776a | [
"Apache-2.0"
] | null | null | null | aula_ORM/aula_ORM/settings.py | dfvalle/project-si7 | a206cc1f34ec2e80432fc0275e4931270212776a | [
"Apache-2.0"
] | 1 | 2019-03-11T20:48:41.000Z | 2019-03-11T20:48:41.000Z | """
Django settings for aula_ORM project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
# ... | 25.598361 | 91 | 0.697727 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '=7n!y$lq-wa5ow8)i68m@z4rvt^_f*v823#s1$(dsvacf^eaj6'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f74b88e96a7545b18a00a7b63944ef1b6b513620 | 1,174 | py | Python | notifications/bgt-traffic-solutions/challenge2.py | jtmorgan/ds4ux | 14c4ece59b367fe7c8db09a126161693b9a640b3 | [
"MIT"
] | null | null | null | notifications/bgt-traffic-solutions/challenge2.py | jtmorgan/ds4ux | 14c4ece59b367fe7c8db09a126161693b9a640b3 | [
"MIT"
] | null | null | null | notifications/bgt-traffic-solutions/challenge2.py | jtmorgan/ds4ux | 14c4ece59b367fe7c8db09a126161693b9a640b3 | [
"MIT"
] | null | null | null | """
What was the busiest hour of any day for northbound bike traffic? How about southbound pedestrian traffic?
"""
import bgt_traffic
busiest_bike_nb = []
busiest_bike_count = 0
busiest_ped_sb = []
busiest_ped_count = 0
for dkey, dval in bgt_traffic.traffic.items():
for hkey, hval in dval.items():
if hva... | 33.542857 | 106 | 0.573254 |
import bgt_traffic
busiest_bike_nb = []
busiest_bike_count = 0
busiest_ped_sb = []
busiest_ped_count = 0
for dkey, dval in bgt_traffic.traffic.items():
for hkey, hval in dval.items():
if hval['bike nb'] > busiest_bike_count:
busiest_bike_count = hval['bike nb']
busiest_bike_nb[:] ... | true | true |
f74b89818f09731a8af701edc5f99e1c12cd3e6e | 21,158 | py | Python | sigutils/plot.py | ryanpdwyer/sigutils | 341513f403dee0b2c49e9630c86f0483c0d2d359 | [
"MIT"
] | null | null | null | sigutils/plot.py | ryanpdwyer/sigutils | 341513f403dee0b2c49e9630c86f0483c0d2d359 | [
"MIT"
] | null | null | null | sigutils/plot.py | ryanpdwyer/sigutils | 341513f403dee0b2c49e9630c86f0483c0d2d359 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
- We should have plotting functions
bode_ba(ba, ...)
Takes an analog transfer function in ba form
bode_z(b, a=1, fs, ...)
Takes a digital transfer function in z form. Is fs, nyq, or dt preferred?
bode_zpk(zpk, fs?, ...)
Use zpk form (or state space?)
... | 33.37224 | 81 | 0.585925 |
from __future__ import division, print_function, absolute_import
from collections import Counter
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
from sigutils._util import (freqresp, freqz, mag_phase)
def adjust_y_ticks(ax, delta):
ylim = np.array(ax.get_yl... | true | true |
f74b89d21bd3d571644c4ae536ac2c19ce6e6f20 | 158,064 | py | Python | core/domain/user_services_test.py | paprajapati9/oppia | 54b2f231043c4b4ef4477bd05b21e347086bfdc9 | [
"Apache-2.0"
] | null | null | null | core/domain/user_services_test.py | paprajapati9/oppia | 54b2f231043c4b4ef4477bd05b21e347086bfdc9 | [
"Apache-2.0"
] | null | null | null | core/domain/user_services_test.py | paprajapati9/oppia | 54b2f231043c4b4ef4477bd05b21e347086bfdc9 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... | 41.90456 | 116 | 0.684508 |
from __future__ import annotations
import datetime
import logging
import os
import re
from core import feconf
from core import utils
from core.constants import constants
from core.domain import auth_services
from core.domain import collection_services
from core.domain import event_services
from core.... | true | true |
f74b8a85e6a6cce306d567873336b2497f94deda | 824 | py | Python | datasets/plot.py | cplan082-tech/project_csi4103 | 987d19deacc8cb36c473adf33335fc63ae4aab10 | [
"MIT"
] | 2 | 2022-03-20T21:38:28.000Z | 2022-03-22T21:23:12.000Z | datasets/plot.py | cplan082-tech/project_csi4103 | 987d19deacc8cb36c473adf33335fc63ae4aab10 | [
"MIT"
] | null | null | null | datasets/plot.py | cplan082-tech/project_csi4103 | 987d19deacc8cb36c473adf33335fc63ae4aab10 | [
"MIT"
] | 1 | 2022-03-20T15:32:27.000Z | 2022-03-20T15:32:27.000Z | import csv
import math
import numpy as np
import matplotlib.pyplot as plt
def read_csv_file(name):
file = open(name)
type(file)
csvreader = csv.reader(file)
header = []
header = next(csvreader) #First line of CSV is name of headers
"Populates array with rows from CSV [[shoulder_angle_1,elbow_... | 21.128205 | 79 | 0.626214 | import csv
import math
import numpy as np
import matplotlib.pyplot as plt
def read_csv_file(name):
file = open(name)
type(file)
csvreader = csv.reader(file)
header = []
header = next(csvreader)
rows = []
for row in csvreader:
rows.append(row)
file.close()
return rows
de... | true | true |
f74b8accd9bb269ddf8b01f4579210e6c982fb54 | 12,981 | py | Python | hathor/transaction/resources/push_tx.py | luislhl/hathor-core | 9fe53b5a6ecb6efd3f4e8ce2ba21d591f0402cc6 | [
"Apache-2.0"
] | 51 | 2019-12-28T03:33:27.000Z | 2022-03-10T14:03:03.000Z | hathor/transaction/resources/push_tx.py | luislhl/hathor-core | 9fe53b5a6ecb6efd3f4e8ce2ba21d591f0402cc6 | [
"Apache-2.0"
] | 316 | 2019-09-10T09:20:05.000Z | 2022-03-31T20:18:56.000Z | hathor/transaction/resources/push_tx.py | luislhl/hathor-core | 9fe53b5a6ecb6efd3f4e8ce2ba21d591f0402cc6 | [
"Apache-2.0"
] | 19 | 2020-01-04T00:13:18.000Z | 2022-02-08T21:18:46.000Z | # Copyright 2021 Hathor Labs
#
# 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, s... | 38.749254 | 109 | 0.465912 |
import struct
from json import JSONDecodeError
from typing import TYPE_CHECKING, Any, Dict, Optional, cast
from hathorlib.base_transaction import tx_or_block_from_bytes as lib_tx_or_block_from_bytes
from structlog import get_logger
from twisted.web import resource
from twisted.web.http import Request
fr... | true | true |
f74b8e010afeb72a0caaa253e324c5b0f9a7a40e | 1,021 | py | Python | eclcli/bare/v2/zone.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 32 | 2016-08-31T04:12:40.000Z | 2020-12-11T04:49:57.000Z | eclcli/bare/v2/zone.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 27 | 2016-09-06T07:50:36.000Z | 2021-09-14T09:46:03.000Z | eclcli/bare/v2/zone.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 24 | 2016-09-02T01:09:09.000Z | 2021-01-19T09:14:16.000Z | from eclcli.common import command
from eclcli.common import utils
from eclcli.bare import bare_utils
class ShowZone(command.Lister):
"""Show availability zone details"""
def get_parser(self, prog_name):
parser = super(ShowZone, self).get_parser(prog_name)
return parser
def take_action(s... | 27.594595 | 66 | 0.545544 | from eclcli.common import command
from eclcli.common import utils
from eclcli.bare import bare_utils
class ShowZone(command.Lister):
def get_parser(self, prog_name):
parser = super(ShowZone, self).get_parser(prog_name)
return parser
def take_action(self, parsed_args):
bare_client = ... | true | true |
f74b8e806ab9e15e52eddff33c8141a1ca90da73 | 2,351 | py | Python | coordPredator.py | thctamm/cs289-final-project | 812d40e1af1d51f505d82d4bd649d6daa704fbd7 | [
"MIT"
] | null | null | null | coordPredator.py | thctamm/cs289-final-project | 812d40e1af1d51f505d82d4bd649d6daa704fbd7 | [
"MIT"
] | null | null | null | coordPredator.py | thctamm/cs289-final-project | 812d40e1af1d51f505d82d4bd649d6daa704fbd7 | [
"MIT"
] | null | null | null | import random, math
from agent import Agent
from variables import *
MAX_NEIGHBOR_FORCE = abs(math.log(PREDATOR_SENSING_DISTANCE/PREDATOR_DESIRED_DIST))
## Built on predator that zig-zags.
## Coordinate with other predators.
class CoordPredator(Agent):
def __init__(self, sim, start_loc = None):
random.seed... | 33.585714 | 115 | 0.574649 | import random, math
from agent import Agent
from variables import *
MAX_NEIGHBOR_FORCE = abs(math.log(PREDATOR_SENSING_DISTANCE/PREDATOR_DESIRED_DIST))
= None):
random.seed()
super().__init__(sim, start_loc)
self.nearby_fish = []
self.nearby_predator = []
self.cooldown = 0
... | true | true |
f74b90511e76bf3b88d1fc5d0c8d4d4b4a3a1073 | 53,747 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuits_operations.py | praveenkuttappan/azure-sdk-for-python | 4b79413667b7539750a6c7dde15737013a3d4bd5 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuits_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_04_01/aio/operations/_express_route_circuits_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 50.993359 | 261 | 0.67507 |
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.... | true | true |
f74b91c8da1bf15f226d2fcb0d732dff687bcc4d | 2,951 | py | Python | nova/tests/unit/cert/test_rpcapi.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/tests/unit/cert/test_rpcapi.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | 2 | 2015-09-07T22:14:46.000Z | 2020-08-12T08:51:56.000Z | nova/tests/unit/cert/test_rpcapi.py | gabriel-samfira/nova | 5ef07cc04dbf0216452ae358e57d9ddac51f1803 | [
"Apache-2.0"
] | 4 | 2015-09-09T16:48:56.000Z | 2022-03-15T20:52:57.000Z | # Copyright 2012, Red Hat, 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 agr... | 34.717647 | 78 | 0.662148 |
import contextlib
import mock
from oslo.config import cfg
from nova.cert import rpcapi as cert_rpcapi
from nova import context
from nova import test
CONF = cfg.CONF
class CertRpcAPITestCase(test.NoDBTestCase):
def _test_cert_api(self, method, **kwargs):
ctxt = context.RequestContext('fak... | true | true |
f74b92ffe90b651d08837a36b8ea135b55755c06 | 19,890 | py | Python | jmespath/parser.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | jmespath/parser.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | jmespath/parser.py | f3n9/qcloudcli | b965a4f0e6cdd79c1245c1d0cd2ca9c460a56f19 | [
"Apache-2.0"
] | null | null | null | """Top down operator precedence parser.
This is an implementation of Vaughan R. Pratt's
"Top Down Operator Precedence" parser.
(http://dl.acm.org/citation.cfm?doid=512927.512931).
These are some additional resources that help explain the
general idea behind a Pratt parser:
* http://effbot.org/zone/simple-to... | 37.741935 | 85 | 0.566918 | import random
from jmespath import lexer
from jmespath.compat import with_repr_method
from jmespath import ast
from jmespath import exceptions
from jmespath import visitor
class Parser(object):
BINDING_POWER = {
'eof': 0,
'unquoted_identifier': 0,
'quoted_identifier': 0,
... | true | true |
f74b937ef012c5f653a2570d530ab477d992c08c | 5,088 | py | Python | source/main.py | JoHyukJun/gdrive-rclone | 310fe3d77843d9e7f732105d6ce068e6602c665e | [
"MIT"
] | null | null | null | source/main.py | JoHyukJun/gdrive-rclone | 310fe3d77843d9e7f732105d6ce068e6602c665e | [
"MIT"
] | null | null | null | source/main.py | JoHyukJun/gdrive-rclone | 310fe3d77843d9e7f732105d6ce068e6602c665e | [
"MIT"
] | null | null | null | import os
import subprocess
from pathlib import Path
from tkinter import *
from tkinter import ttk
from tkinter import font
BASE_DIR = Path(__file__).resolve(strict=True).parent
RCLONE = BASE_DIR / 'rclone/rclone.exe'
# subprocess.run([RCLONE, 'ls'], shell=True)
class Application(Frame):
def __init__(self, ... | 31.407407 | 140 | 0.621855 | import os
import subprocess
from pathlib import Path
from tkinter import *
from tkinter import ttk
from tkinter import font
BASE_DIR = Path(__file__).resolve(strict=True).parent
RCLONE = BASE_DIR / 'rclone/rclone.exe'
class Application(Frame):
def __init__(self, master=None):
super().__init__(maste... | true | true |
f74b9383c2c8fc750ef1640d1fd1cf582b26be18 | 5,342 | py | Python | sdk/python/pulumi_azure_native/storagesync/v20191001/get_storage_sync_service.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20191001/get_storage_sync_service.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/storagesync/v20191001/get_storage_sync_service.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
__a... | 37.097222 | 193 | 0.668476 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = [
'GetStorageSyncServiceResult',
'AwaitableGetStorageSyncServiceResult',
'get_storage_sync_service',
]
@pulumi.output_type
class GetStorageSyncSe... | true | true |
f74b93f2ba91c860ce8e8dca9c307f3dd4f8e782 | 464 | py | Python | toontown/coghq/PaintMixer.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/coghq/PaintMixer.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/coghq/PaintMixer.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from toontown.coghq import PlatformEntity
class PaintMixer(PlatformEntity.PlatformEntity):
def start(self):
PlatformEntity.PlatformEntity.start(self)
model = self.platform.model
shaft = model.find('**/PaintMixerBase1')
shaft.setSz(self.shaftScale)
shaft.node().setPreserveTr... | 33.142857 | 52 | 0.689655 | from toontown.coghq import PlatformEntity
class PaintMixer(PlatformEntity.PlatformEntity):
def start(self):
PlatformEntity.PlatformEntity.start(self)
model = self.platform.model
shaft = model.find('**/PaintMixerBase1')
shaft.setSz(self.shaftScale)
shaft.node().setPreserveTr... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.