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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7256c23b14e3bf3204687769f2e778d96ed7ed4 | 2,818 | py | Python | MA cross.py | 0xTDF/Quant-Trading-Strategy-Backtesting-Framework | d77089bab3513013d456819e9790e67e44adec8e | [
"MIT"
] | 1 | 2022-03-25T07:50:15.000Z | 2022-03-25T07:50:15.000Z | MA cross.py | Elisik/Quant-Trading-Strategy-Backtesting-Framework | d77089bab3513013d456819e9790e67e44adec8e | [
"MIT"
] | null | null | null | MA cross.py | Elisik/Quant-Trading-Strategy-Backtesting-Framework | d77089bab3513013d456819e9790e67e44adec8e | [
"MIT"
] | null | null | null | import backtrader as bt
import backtrader.analyzers as bta
from datetime import datetime
import matplotlib.pyplot as plt
import yfinance
class MaCrossStrategy(bt.Strategy):
# signal generator
def __init__(self):
ma_fast = bt.ind.SMA(period = 10)
ma_slow = bt.ind.SMA(period = 20)... | 26.584906 | 79 | 0.694109 | import backtrader as bt
import backtrader.analyzers as bta
from datetime import datetime
import matplotlib.pyplot as plt
import yfinance
class MaCrossStrategy(bt.Strategy):
def __init__(self):
ma_fast = bt.ind.SMA(period = 10)
ma_slow = bt.ind.SMA(period = 20)
self.cr... | true | true |
f7256d283ba52ce9290a4bd6ce811edcc7a1208a | 8,082 | py | Python | juriscraper/opinions/united_states_backscrapers/federal_appellate/ca5.py | drewsilcock/juriscraper | 706a05f739e10f22b81b9bb16767415d810e49d1 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states_backscrapers/federal_appellate/ca5.py | drewsilcock/juriscraper | 706a05f739e10f22b81b9bb16767415d810e49d1 | [
"BSD-2-Clause"
] | null | null | null | juriscraper/opinions/united_states_backscrapers/federal_appellate/ca5.py | drewsilcock/juriscraper | 706a05f739e10f22b81b9bb16767415d810e49d1 | [
"BSD-2-Clause"
] | null | null | null | from lxml import html
from datetime import datetime, timedelta, date
from dateutil.rrule import DAILY, rrule
from selenium.common.exceptions import NoSuchElementException
from juriscraper.AbstractSite import logger
from juriscraper.OpinionSiteWebDriven import OpinionSiteWebDriven
class Site(OpinionSiteWebDriven):
... | 39.23301 | 118 | 0.548627 | from lxml import html
from datetime import datetime, timedelta, date
from dateutil.rrule import DAILY, rrule
from selenium.common.exceptions import NoSuchElementException
from juriscraper.AbstractSite import logger
from juriscraper.OpinionSiteWebDriven import OpinionSiteWebDriven
class Site(OpinionSiteWebDriven):
... | true | true |
f7256de9d9a438b0f395aac6da42babe3f3800f4 | 11,937 | py | Python | tests/integration/test_polymorphic_parts/test.py | monadbobo/ClickHouse | 73b0f8db8c327a1d63cc7ebcc56087a3f9866dae | [
"Apache-2.0"
] | 3 | 2021-09-14T08:36:18.000Z | 2022-02-24T02:55:38.000Z | tests/integration/test_polymorphic_parts/test.py | monadbobo/ClickHouse | 73b0f8db8c327a1d63cc7ebcc56087a3f9866dae | [
"Apache-2.0"
] | 1 | 2020-04-04T04:25:47.000Z | 2020-04-04T04:25:47.000Z | tests/integration/test_polymorphic_parts/test.py | monadbobo/ClickHouse | 73b0f8db8c327a1d63cc7ebcc56087a3f9866dae | [
"Apache-2.0"
] | 1 | 2020-05-18T11:31:48.000Z | 2020-05-18T11:31:48.000Z | import time
import pytest
import random
import string
from helpers.test_tools import TSV
from helpers.test_tools import assert_eq_with_retry
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
def get_random_array():
return [random.randint(0, 1000) % 1000 for _ in range(random.ran... | 45.387833 | 170 | 0.70981 | import time
import pytest
import random
import string
from helpers.test_tools import TSV
from helpers.test_tools import assert_eq_with_retry
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
def get_random_array():
return [random.randint(0, 1000) % 1000 for _ in range(random.ran... | true | true |
f7256dea781fbaf1c92c2fd539b3e3cfbad4cd6e | 214 | py | Python | Lectures/9 - Matlib/test.py | JensRL/PPaNM | a28d9826d24c821cbc35a2e5fb5c478118f1e693 | [
"MIT"
] | null | null | null | Lectures/9 - Matlib/test.py | JensRL/PPaNM | a28d9826d24c821cbc35a2e5fb5c478118f1e693 | [
"MIT"
] | null | null | null | Lectures/9 - Matlib/test.py | JensRL/PPaNM | a28d9826d24c821cbc35a2e5fb5c478118f1e693 | [
"MIT"
] | null | null | null | import math
import scipy.integrate as integrate
ncalls = 0
def f(x):
global ncalls
ncalls +=1
return math.log(x)/math.sqrt(x)
result = integrate.quad(f,0,1)
print("result=", result, "ncalls =",ncalls) | 214 | 214 | 0.682243 | import math
import scipy.integrate as integrate
ncalls = 0
def f(x):
global ncalls
ncalls +=1
return math.log(x)/math.sqrt(x)
result = integrate.quad(f,0,1)
print("result=", result, "ncalls =",ncalls) | true | true |
f7256e40446cfaf2d265b8165ba99a61224d4a30 | 1,336 | py | Python | apache2/htdocs/syntax/string4.py | tigerish009/mampstack-8.0.0-0 | d4d0550e0d29d850ebd9a2b70c3f16641de0e1bf | [
"Apache-2.0"
] | null | null | null | apache2/htdocs/syntax/string4.py | tigerish009/mampstack-8.0.0-0 | d4d0550e0d29d850ebd9a2b70c3f16641de0e1bf | [
"Apache-2.0"
] | null | null | null | apache2/htdocs/syntax/string4.py | tigerish009/mampstack-8.0.0-0 | d4d0550e0d29d850ebd9a2b70c3f16641de0e1bf | [
"Apache-2.0"
] | null | null | null | #positional formatting
print('to {}.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry sstandard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries... | 222.666667 | 653 | 0.797156 |
print('to {}.Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry sstandard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap in... | true | true |
f7256ea03f1ba9c7d22b3e985d8dc7af2edfcdc4 | 2,525 | py | Python | bentoml/adapters/dataframe_output.py | d3m0n-r00t/BentoML | e5c53b821369f5391de9ab3a20ecad5db9e77202 | [
"Apache-2.0"
] | null | null | null | bentoml/adapters/dataframe_output.py | d3m0n-r00t/BentoML | e5c53b821369f5391de9ab3a20ecad5db9e77202 | [
"Apache-2.0"
] | null | null | null | bentoml/adapters/dataframe_output.py | d3m0n-r00t/BentoML | e5c53b821369f5391de9ab3a20ecad5db9e77202 | [
"Apache-2.0"
] | null | null | null | import json
from typing import Sequence
from bentoml.adapters.json_output import JsonOutput
from bentoml.types import InferenceError, InferenceResult, InferenceTask
from bentoml.utils.dataframe_util import PANDAS_DATAFRAME_TO_JSON_ORIENT_OPTIONS
def df_to_json(result, pandas_dataframe_orient="records"):
import p... | 33.666667 | 82 | 0.65901 | import json
from typing import Sequence
from bentoml.adapters.json_output import JsonOutput
from bentoml.types import InferenceError, InferenceResult, InferenceTask
from bentoml.utils.dataframe_util import PANDAS_DATAFRAME_TO_JSON_ORIENT_OPTIONS
def df_to_json(result, pandas_dataframe_orient="records"):
import p... | true | true |
f7256eb9c87e025bed52453bc1d07f3c08e79dcc | 1,581 | py | Python | samples/generated_samples/vmmigration_v1_generated_vm_migration_create_source_sync.py | renovate-bot/python-vmmigration | 80a2cf46a21f516899da818a7aec0f2a67222047 | [
"Apache-2.0"
] | null | null | null | samples/generated_samples/vmmigration_v1_generated_vm_migration_create_source_sync.py | renovate-bot/python-vmmigration | 80a2cf46a21f516899da818a7aec0f2a67222047 | [
"Apache-2.0"
] | 10 | 2021-11-18T10:47:48.000Z | 2022-03-07T15:48:54.000Z | samples/generated_samples/vmmigration_v1_generated_vm_migration_create_source_sync.py | renovate-bot/python-vmmigration | 80a2cf46a21f516899da818a7aec0f2a67222047 | [
"Apache-2.0"
] | 1 | 2022-01-29T08:15:02.000Z | 2022-01-29T08:15:02.000Z | # -*- coding: utf-8 -*-
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 31 | 85 | 0.752056 |
from google.cloud import vmmigration_v1
def sample_create_source():
client = vmmigration_v1.VmMigrationClient()
request = vmmigration_v1.CreateSourceRequest(
parent="parent_value",
source_id="source_id_value",
)
operation = client.create_sourc... | true | true |
f7256ed5b108211f2458fd64f6a79da2e72b170a | 62,996 | py | Python | site-packages/sklearn/linear_model/_stochastic_gradient.py | linusg/Pyto | eab3c3e093a8cace53d5b9425d1af2f535d456ee | [
"MIT"
] | 2 | 2020-08-25T13:55:00.000Z | 2020-08-25T16:36:03.000Z | site-packages/sklearn/linear_model/_stochastic_gradient.py | linusg/Pyto | eab3c3e093a8cace53d5b9425d1af2f535d456ee | [
"MIT"
] | 1 | 2020-04-25T20:36:07.000Z | 2020-04-25T20:36:07.000Z | site-packages/sklearn/linear_model/_stochastic_gradient.py | Wristlebane/Pyto | 901ac307b68486d8289105c159ca702318bea5b0 | [
"MIT"
] | null | null | null | # Authors: Peter Prettenhofer <peter.prettenhofer@gmail.com> (main author)
# Mathieu Blondel (partial_fit support)
#
# License: BSD 3 clause
"""Classification and regression using Stochastic Gradient Descent (SGD)."""
import numpy as np
import warnings
from abc import ABCMeta, abstractmethod
from joblib imp... | 41.254748 | 79 | 0.604308 |
import numpy as np
import warnings
from abc import ABCMeta, abstractmethod
from joblib import Parallel, delayed
from ..base import clone, is_classifier
from ._base import LinearClassifierMixin, SparseCoefMixin
from ._base import make_dataset
from ..base import BaseEstimator, RegressorMixin
from ..utils import c... | true | true |
f7256edb1cd981f4d5a110f018a377b55aa4f7c7 | 1,246 | py | Python | Model prediction/app.py | choudhury722k/English-to-French-translator | e792ce92adbdd3100d73d9d8aebc109cc7c560d7 | [
"MIT"
] | null | null | null | Model prediction/app.py | choudhury722k/English-to-French-translator | e792ce92adbdd3100d73d9d8aebc109cc7c560d7 | [
"MIT"
] | null | null | null | Model prediction/app.py | choudhury722k/English-to-French-translator | e792ce92adbdd3100d73d9d8aebc109cc7c560d7 | [
"MIT"
] | null | null | null | from re import X
from flask import Flask,render_template,url_for,request
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras import models
import numpy as np
import pickle
french_tokenizer = pickle.load(open('french_tokenize... | 31.948718 | 81 | 0.719904 | from re import X
from flask import Flask,render_template,url_for,request
from tensorflow.keras.preprocessing.text import Tokenizer
from tensorflow.keras.preprocessing.sequence import pad_sequences
from tensorflow.keras import models
import numpy as np
import pickle
french_tokenizer = pickle.load(open('french_tokenize... | true | true |
f7256eedcf3a758fc0b86618617827425e34c972 | 438 | py | Python | carpyncho2/carpyncho/steps/prepare_pawprint_to_sync.py | carpyncho/yeolde_carpyncho | fba72ebf9d4a3e4e4ea18160310058c6812a0457 | [
"BSD-3-Clause"
] | null | null | null | carpyncho2/carpyncho/steps/prepare_pawprint_to_sync.py | carpyncho/yeolde_carpyncho | fba72ebf9d4a3e4e4ea18160310058c6812a0457 | [
"BSD-3-Clause"
] | 2 | 2020-06-05T19:37:26.000Z | 2020-06-05T19:40:38.000Z | carpyncho2/carpyncho/steps/prepare_pawprint_to_sync.py | carpyncho/yeolde_carpyncho | fba72ebf9d4a3e4e4ea18160310058c6812a0457 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from corral import run
from ..models import PawprintXTile
class PreparePawprintToSync(run.Step):
model = PawprintXTile
conditions = [
PawprintXTile.status == "raw",
PawprintXTile.tile.has(status="loaded"),
PawprintXTile.pawprint.has(stat... | 19.909091 | 51 | 0.630137 |
from corral import run
from ..models import PawprintXTile
class PreparePawprintToSync(run.Step):
model = PawprintXTile
conditions = [
PawprintXTile.status == "raw",
PawprintXTile.tile.has(status="loaded"),
PawprintXTile.pawprint.has(status="loaded")
]
limit = 500
group... | true | true |
f7256fad4dd4f8677f2d6bac3cf8110e20ecf681 | 423 | py | Python | mysite/mysite/development_settings.py | timmahrt/gamecorpus | 6ce170f3d590475a320410c9d937039555207ee9 | [
"MIT"
] | null | null | null | mysite/mysite/development_settings.py | timmahrt/gamecorpus | 6ce170f3d590475a320410c9d937039555207ee9 | [
"MIT"
] | null | null | null | mysite/mysite/development_settings.py | timmahrt/gamecorpus | 6ce170f3d590475a320410c9d937039555207ee9 | [
"MIT"
] | null | null | null | from mysite.common_settings import *
SECRET_KEY = "aje#lg$7!t!tc5*i%ittn(to%5#5%vjvi*oc=ib25wx%+##_b+"
DEBUG = True
ALLOWED_HOSTS = ["*"]
# Database
# https://docs.djangoproject.com/en/3.1/ref/settings/#databases
DATABASES = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "game_cor... | 21.15 | 65 | 0.591017 | from mysite.common_settings import *
SECRET_KEY = "aje#lg$7!t!tc5*i%ittn(to%5#5%vjvi*oc=ib25wx%+##_b+"
DEBUG = True
ALLOWED_HOSTS = ["*"]
S = {
"default": {
"ENGINE": "django.db.backends.mysql",
"NAME": "game_corpus_db",
"HOST": "127.0.0.1",
"USER": "tmahrt",
"PASSWORD":... | true | true |
f725707d1175e051257c22b78d93284af9b6061b | 4,819 | py | Python | catalyst/engines/tests/test_parallel.py | alxmamaev/catalyst | d05120c68fbc5174ff74297d29c0fc00d7e94924 | [
"Apache-2.0"
] | 1 | 2021-03-02T12:06:32.000Z | 2021-03-02T12:06:32.000Z | catalyst/engines/tests/test_parallel.py | alxmamaev/catalyst | d05120c68fbc5174ff74297d29c0fc00d7e94924 | [
"Apache-2.0"
] | null | null | null | catalyst/engines/tests/test_parallel.py | alxmamaev/catalyst | d05120c68fbc5174ff74297d29c0fc00d7e94924 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
from typing import Any, Dict, List
import logging
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch.utils.data import DataLoader
from catalyst.callbacks import CheckpointCallback, CriterionCallback, OptimizerCallback
from catalyst.core.runner import IRunner
from c... | 34.421429 | 97 | 0.573563 |
from typing import Any, Dict, List
import logging
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch.utils.data import DataLoader
from catalyst.callbacks import CheckpointCallback, CriterionCallback, OptimizerCallback
from catalyst.core.runner import IRunner
from catalyst.engine... | true | true |
f72572a5ded8e8384c8775f3509841aff1d8e01a | 1,939 | py | Python | tests/test_issues/test_issue_25.py | cmungall/PyShEx | 43026c4b0393362e770b868794c5d9071e691d6f | [
"CC0-1.0"
] | 25 | 2018-01-11T10:59:16.000Z | 2021-07-02T03:44:02.000Z | tests/test_issues/test_issue_25.py | cmungall/PyShEx | 43026c4b0393362e770b868794c5d9071e691d6f | [
"CC0-1.0"
] | 66 | 2018-03-12T01:12:02.000Z | 2022-03-18T07:56:31.000Z | tests/test_issues/test_issue_25.py | cmungall/PyShEx | 43026c4b0393362e770b868794c5d9071e691d6f | [
"CC0-1.0"
] | 12 | 2018-04-06T11:29:40.000Z | 2021-12-17T22:48:07.000Z | import os
import unittest
from contextlib import redirect_stdout, redirect_stderr
from io import StringIO
from pyshex.shex_evaluator import evaluate_cli
data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'data'))
validation_dir = os.path.join(data_dir, 'validation')
rdffile = os.path.join(valida... | 35.254545 | 105 | 0.66426 | import os
import unittest
from contextlib import redirect_stdout, redirect_stderr
from io import StringIO
from pyshex.shex_evaluator import evaluate_cli
data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'data'))
validation_dir = os.path.join(data_dir, 'validation')
rdffile = os.path.join(valida... | true | true |
f725742c34d7363a4d55d7cc29936dc1953858f7 | 3,975 | py | Python | cpp/build-support/lint_cpp_cli.py | LuoZijun/arrow | 8219a8b878d9344fe73e07def34a18a71a8f85a8 | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0"
] | 1 | 2020-09-15T16:47:08.000Z | 2020-09-15T16:47:08.000Z | cpp/build-support/lint_cpp_cli.py | LuoZijun/arrow | 8219a8b878d9344fe73e07def34a18a71a8f85a8 | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0"
] | 3 | 2018-10-25T13:52:14.000Z | 2018-10-27T08:44:27.000Z | cpp/build-support/lint_cpp_cli.py | LuoZijun/arrow | 8219a8b878d9344fe73e07def34a18a71a8f85a8 | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0"
] | 10 | 2019-03-18T08:19:16.000Z | 2020-09-15T09:05:39.000Z | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "Li... | 31.054688 | 76 | 0.610063 |
import argparse
import re
import os
parser = argparse.ArgumentParser(
description="Check for illegal headers for C++/CLI applications")
parser.add_argument("source_path",
help="Path to source code")
arguments = parser.parse_args()
_STRIP_COMMENT_REGEX = re.compile('(.+)?(?=/... | true | true |
f72574687e5a2e271c479e18ac1e881bdf5eae75 | 578 | py | Python | azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 2 | 2016-09-30T21:40:24.000Z | 2017-11-10T18:16:18.000Z | azure-mgmt-consumption/azure/mgmt/consumption/models/consumption_management_client_enums.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 30.421053 | 76 | 0.550173 |
from enum import Enum
class Datagrain(Enum):
daily_grain = "daily"
monthly_grain = "monthly"
| true | true |
f725747bf99d90df726266e21ecdd3c5dc730fc5 | 16,227 | py | Python | pyfarm/models/core/mixins.py | guidow/pyfarm-master | d41c8f1eb5bfefb8400d400bcecadf197bcfb80a | [
"Apache-2.0"
] | null | null | null | pyfarm/models/core/mixins.py | guidow/pyfarm-master | d41c8f1eb5bfefb8400d400bcecadf197bcfb80a | [
"Apache-2.0"
] | null | null | null | pyfarm/models/core/mixins.py | guidow/pyfarm-master | d41c8f1eb5bfefb8400d400bcecadf197bcfb80a | [
"Apache-2.0"
] | null | null | null | # No shebang line, this module is meant to be imported
#
# Copyright 2013 Oliver Palmer
#
# 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
#
# U... | 37.21789 | 81 | 0.570038 |
from datetime import datetime
from collections import namedtuple
try:
from httplib import INTERNAL_SERVER_ERROR
except ImportError:
from http.client import INTERNAL_SERVER_ERROR
from sqlalchemy.orm import validates, class_mapper
from pyfarm.core.enums import _WorkState, Values, PY2
from pyfa... | true | true |
f7257517d39b2f8675741bc3a48ae828e67d5468 | 495 | py | Python | src/commercetools/services/abstract.py | labd/commercetools-python-sdk | d8ec285f08d56ede2e4cad45c74833f5b609ab5c | [
"MIT"
] | 15 | 2018-11-02T14:35:52.000Z | 2022-03-16T07:51:44.000Z | src/commercetools/services/abstract.py | lime-green/commercetools-python-sdk | 63b77f6e5abe43e2b3ebbf3cdbbe00c7cf80dca6 | [
"MIT"
] | 84 | 2018-11-02T12:50:32.000Z | 2022-03-22T01:25:54.000Z | src/commercetools/services/abstract.py | lime-green/commercetools-python-sdk | 63b77f6e5abe43e2b3ebbf3cdbbe00c7cf80dca6 | [
"MIT"
] | 13 | 2019-01-03T09:16:50.000Z | 2022-02-15T18:37:19.000Z | import typing
from marshmallow.base import SchemaABC
if typing.TYPE_CHECKING:
from commercetools.client import Client
class AbstractService:
def __init__(self, client: "Client") -> None:
self._client = client
self._schemas: typing.Dict[str, SchemaABC] = {}
def _serialize_params(self, pa... | 27.5 | 73 | 0.684848 | import typing
from marshmallow.base import SchemaABC
if typing.TYPE_CHECKING:
from commercetools.client import Client
class AbstractService:
def __init__(self, client: "Client") -> None:
self._client = client
self._schemas: typing.Dict[str, SchemaABC] = {}
def _serialize_params(self, pa... | true | true |
f72576ba10ecc45859e387a54131b2e173076e5e | 13,744 | py | Python | pinpayments/tests/models.py | branchup/django-pinpayments | e342970c6309facf35b804de9994d326abaa094f | [
"Unlicense"
] | null | null | null | pinpayments/tests/models.py | branchup/django-pinpayments | e342970c6309facf35b804de9994d326abaa094f | [
"Unlicense"
] | null | null | null | pinpayments/tests/models.py | branchup/django-pinpayments | e342970c6309facf35b804de9994d326abaa094f | [
"Unlicense"
] | null | null | null | """ Ensure that the models work as intended """
import json
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from mock import patch
from pinpayments.models import (
ConfigError,
CustomerToken,
PinErr... | 39.608069 | 79 | 0.621799 | import json
from django.conf import settings
from django.contrib.auth.models import User
from django.test import TestCase
from django.test.utils import override_settings
from mock import patch
from pinpayments.models import (
ConfigError,
CustomerToken,
PinError,
PinTransaction
)
from requests import Re... | true | true |
f72576c2d1acd4d4c339871d110e259e22d8e73b | 13,114 | py | Python | sdk/python/pulumi_azure_native/network/v20200501/express_route_circuit_authorization.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200501/express_route_circuit_authorization.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20200501/express_route_circuit_authorization.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 82.477987 | 6,429 | 0.753317 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from ._enums import *
__all__ = ['ExpressRouteCircuitAuthorization']
class ExpressRouteCircuitAuthorization(pulumi.CustomResource):
def __init__(__self__,
... | true | true |
f725772c43f53c9873559775e2e56aabd5ec8fda | 13,185 | py | Python | aps/loader/simu.py | LvHang/aps | 3e9c8b247e0526481970c28e8af1a6a93cc7f2cc | [
"Apache-2.0"
] | 5 | 2021-07-05T12:21:44.000Z | 2021-11-23T08:09:45.000Z | aps/loader/simu.py | LvHang/aps | 3e9c8b247e0526481970c28e8af1a6a93cc7f2cc | [
"Apache-2.0"
] | null | null | null | aps/loader/simu.py | LvHang/aps | 3e9c8b247e0526481970c28e8af1a6a93cc7f2cc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2020 Jian Wu
# License: Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""
Adopt from my another project: https://github.com/funcwj/setk
See https://github.com/funcwj/setk/tree/master/doc/data_simu for command line usage
"""
import argparse
import numpy as np
from aps.loader... | 36.222527 | 92 | 0.498597 |
import argparse
import numpy as np
from aps.loader.audio import read_audio, add_room_response
from aps.opts import StrToBoolAction
from aps.const import EPSILON
def coeff_snr(sig_pow, ref_pow, snr):
return (ref_pow / (sig_pow * 10**(snr / 10) + EPSILON))**0.5
def add_speaker(mix_nsamps,
src... | true | true |
f7257753ce0834da08cef9848377fb031be44fc6 | 2,553 | py | Python | tests/test_parametric_printer_coverage.py | ka3bhy/wexpect | 14a4279579a740ce15743db44228f3b0cf4ee8f4 | [
"MIT"
] | 52 | 2019-04-24T14:38:43.000Z | 2022-03-08T22:03:11.000Z | tests/test_parametric_printer_coverage.py | ka3bhy/wexpect | 14a4279579a740ce15743db44228f3b0cf4ee8f4 | [
"MIT"
] | 51 | 2019-05-13T12:15:09.000Z | 2021-12-15T14:00:15.000Z | tests/test_parametric_printer_coverage.py | ka3bhy/wexpect | 14a4279579a740ce15743db44228f3b0cf4ee8f4 | [
"MIT"
] | 20 | 2019-07-15T15:48:31.000Z | 2022-03-27T08:55:17.000Z | import wexpect
import unittest
import sys
import os
import time
from tests import PexpectTestCase
@unittest.skipIf(wexpect.spawn_class_name == 'legacy_wexpect', "legacy unsupported")
class TestCaseParametricPrinter(PexpectTestCase.PexpectTestCase):
def test_all_line_length (self):
here = os.path.dirname(o... | 36.471429 | 166 | 0.613396 | import wexpect
import unittest
import sys
import os
import time
from tests import PexpectTestCase
@unittest.skipIf(wexpect.spawn_class_name == 'legacy_wexpect', "legacy unsupported")
class TestCaseParametricPrinter(PexpectTestCase.PexpectTestCase):
def test_all_line_length (self):
here = os.path.dirname(o... | true | true |
f725787c40eac809defe6a07fbbbbed9170067b9 | 3,731 | py | Python | contrib/macdeploy/custom_dsstore.py | BufferUnderwhelm/asspennies | 919be76d6d4be42fea02af1194df2875b91c85dc | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | BufferUnderwhelm/asspennies | 919be76d6d4be42fea02af1194df2875b91c85dc | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | BufferUnderwhelm/asspennies | 919be76d6d4be42fea02af1194df2875b91c85dc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv... | 62.183333 | 1,817 | 0.725811 |
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv[1]
package_name_ns = sys.argv[2]
ds = DSStore.open(output_file, 'w+')
ds['.']['bwsp'] = {
'ShowStatusBar': False,
'WindowBounds': '{{300, 280}, {500, 343}}',
'ContainerShowSidebar': False,
'Si... | true | true |
f72579efb9020b0aeda91f6744f1f71d26ad9971 | 380 | py | Python | yandex_checkout/domain/models/payment_data/payment_data_factory.py | pavel52rus/yandex-checkout-sdk-python | 10c8b0ce12712bca675254f2a230f9fc0e1cb9b4 | [
"MIT"
] | null | null | null | yandex_checkout/domain/models/payment_data/payment_data_factory.py | pavel52rus/yandex-checkout-sdk-python | 10c8b0ce12712bca675254f2a230f9fc0e1cb9b4 | [
"MIT"
] | null | null | null | yandex_checkout/domain/models/payment_data/payment_data_factory.py | pavel52rus/yandex-checkout-sdk-python | 10c8b0ce12712bca675254f2a230f9fc0e1cb9b4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from yandex_checkout.domain.common.type_factory import TypeFactory
from yandex_checkout.domain.models.payment_data.payment_data_class_map import PaymentDataClassMap
class PaymentDataFactory(TypeFactory):
"""
Factory for payment data objects
"""
def __init__(self):
supe... | 29.230769 | 97 | 0.765789 |
from yandex_checkout.domain.common.type_factory import TypeFactory
from yandex_checkout.domain.models.payment_data.payment_data_class_map import PaymentDataClassMap
class PaymentDataFactory(TypeFactory):
def __init__(self):
super(PaymentDataFactory, self).__init__(PaymentDataClassMap())
| true | true |
f7257ab79e200ce2c0c75e0ae6d7b38cf586e521 | 4,649 | py | Python | ee/clickhouse/queries/paths/path_event_query.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | null | null | null | ee/clickhouse/queries/paths/path_event_query.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | null | null | null | ee/clickhouse/queries/paths/path_event_query.py | thinhnguyenuit/posthog | 4758e66790485587d29a617174158d07341342f8 | [
"MIT"
] | null | null | null | from typing import Any, Dict, Tuple
from ee.clickhouse.models.property import get_property_string_expr
from ee.clickhouse.queries.event_query import ClickhouseEventQuery
from posthog.constants import AUTOCAPTURE_EVENT, PAGEVIEW_EVENT, SCREEN_EVENT
from posthog.models.filters.path_filter import PathFilter
class PathE... | 39.735043 | 151 | 0.655195 | from typing import Any, Dict, Tuple
from ee.clickhouse.models.property import get_property_string_expr
from ee.clickhouse.queries.event_query import ClickhouseEventQuery
from posthog.constants import AUTOCAPTURE_EVENT, PAGEVIEW_EVENT, SCREEN_EVENT
from posthog.models.filters.path_filter import PathFilter
class PathE... | true | true |
f7257ab8f76526d2fc5780943a2451a7b5e04d54 | 4,946 | py | Python | example_scenes/basic.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | 2 | 2022-03-31T08:31:00.000Z | 2022-03-31T08:31:43.000Z | example_scenes/basic.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | null | null | null | example_scenes/basic.py | Pow3r5/manim | 2972a64342aa5ae72977b444f653b05250ab1f8f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from manim import *
# To watch one of these scenes, run the following:
# python --quality m manim -p example_scenes.py SquareToCircle
#
# Use the flag --quality l for a faster rendering at a lower quality.
# Use -s to skip to the end and just save the final frame
# Use the -p to have preview of... | 29.975758 | 87 | 0.558229 |
from manim import *
class OpeningManim(Scene):
def construct(self):
title = Tex(r"This is some \LaTeX")
basel = MathTex(r"\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6}")
VGroup(title, basel).arrange(DOWN)
self.play(
Write(title),
FadeIn(bas... | true | true |
f7257af7f5369ac97b09687baeec3f79676d59fb | 17,484 | py | Python | SE4TeC_demo/GUI_function.py | JingweiZuo/SE2TeC | f2aab845aa648e366d0f6917a5d8abfd4d556d13 | [
"Apache-2.0"
] | 1 | 2020-05-10T11:23:11.000Z | 2020-05-10T11:23:11.000Z | SE4TeC_demo/GUI_function.py | JingweiZuo/SE4TeC | f2aab845aa648e366d0f6917a5d8abfd4d556d13 | [
"Apache-2.0"
] | null | null | null | SE4TeC_demo/GUI_function.py | JingweiZuo/SE4TeC | f2aab845aa648e366d0f6917a5d8abfd4d556d13 | [
"Apache-2.0"
] | null | null | null | import time
import tkinter as tk
from tkinter import *
import tkinter.filedialog as filedialog
from tkinter.filedialog import askopenfilename
import utils.utils as util
import utils.similarity_measures as sm
import SMAP.MatrixProfile as mp
import matplotlib
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg... | 42.643902 | 162 | 0.623256 | import time
import tkinter as tk
from tkinter import *
import tkinter.filedialog as filedialog
from tkinter.filedialog import askopenfilename
import utils.utils as util
import utils.similarity_measures as sm
import SMAP.MatrixProfile as mp
import matplotlib
matplotlib.use("TkAgg")
from matplotlib.backends.backend_tkagg... | true | true |
f7257b07ee9ab3353bab98ac28e4ae6d47c6bf1c | 2,171 | py | Python | cifar10/models/repnet.py | NNHieu/loss-landscape | dfe517f23993ffbafea99272026d09e074e50b4f | [
"MIT"
] | null | null | null | cifar10/models/repnet.py | NNHieu/loss-landscape | dfe517f23993ffbafea99272026d09e074e50b4f | [
"MIT"
] | null | null | null | cifar10/models/repnet.py | NNHieu/loss-landscape | dfe517f23993ffbafea99272026d09e074e50b4f | [
"MIT"
] | null | null | null |
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
import torch.autograd as autograd
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
import torch.optim as optim
import os
import argparse
class ResNetLayer(nn.Module):
... | 30.577465 | 109 | 0.607094 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import matplotlib.pyplot as plt
import torch.autograd as autograd
from torchvision import datasets, transforms
from torch.utils.data import DataLoader
import torch.optim as optim
import os
import argparse
class ResNetLayer(nn.Module):
... | true | true |
f7257b2056fac589a4b126844ed598c5e63b20c6 | 635 | py | Python | manage.py | nrsharip/iss-web | e8ca66ade3933dfac4795ba7c44e067c26a079e2 | [
"MIT"
] | 1 | 2020-09-08T21:47:50.000Z | 2020-09-08T21:47:50.000Z | manage.py | nrsharip/iss-web | e8ca66ade3933dfac4795ba7c44e067c26a079e2 | [
"MIT"
] | null | null | null | manage.py | nrsharip/iss-web | e8ca66ade3933dfac4795ba7c44e067c26a079e2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'web_server_moex.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rais... | 28.863636 | 79 | 0.686614 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'web_server_moex.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and... | true | true |
f7257b772a4fb5328778dcbc7b3b0d836de83e58 | 20,431 | py | Python | beta/spreadtrading/stEngine.py | black0144/vnpy | 0d0ea30dad14a0150f7500ff9a62528030321426 | [
"MIT"
] | 18 | 2019-02-21T05:42:41.000Z | 2022-03-31T10:17:51.000Z | beta/spreadtrading/stEngine.py | black0144/vnpy | 0d0ea30dad14a0150f7500ff9a62528030321426 | [
"MIT"
] | 1 | 2018-06-12T10:08:24.000Z | 2018-06-12T10:08:24.000Z | beta/spreadtrading/stEngine.py | black0144/vnpy | 0d0ea30dad14a0150f7500ff9a62528030321426 | [
"MIT"
] | 5 | 2017-12-20T09:57:17.000Z | 2021-08-01T19:47:14.000Z | # encoding: UTF-8
import json
import traceback
import shelve
import parser
import re
from vnpy.event import Event
from vnpy.trader.vtFunction import getJsonPath, getTempPath
from vnpy.trader.vtEvent import (EVENT_TICK, EVENT_TRADE, EVENT_POSITION,
EVENT_TIMER, EVENT_ORDER)
from vnpy.... | 34.805792 | 89 | 0.467623 |
import json
import traceback
import shelve
import parser
import re
from vnpy.event import Event
from vnpy.trader.vtFunction import getJsonPath, getTempPath
from vnpy.trader.vtEvent import (EVENT_TICK, EVENT_TRADE, EVENT_POSITION,
EVENT_TIMER, EVENT_ORDER)
from vnpy.trader.vtObject i... | true | true |
f7257c269b0dd8b39aab1647dd5c4b9c17e4563f | 13,360 | py | Python | server/models/postgis/user.py | rustyb/osm-ireland-tasking-manager | 958c232ba50ca02e5adbc7541a4b9efa7186bfdc | [
"BSD-2-Clause"
] | null | null | null | server/models/postgis/user.py | rustyb/osm-ireland-tasking-manager | 958c232ba50ca02e5adbc7541a4b9efa7186bfdc | [
"BSD-2-Clause"
] | 4 | 2020-03-24T17:47:26.000Z | 2021-06-02T00:32:15.000Z | server/models/postgis/user.py | rustyb/osm-ireland-tasking-manager | 958c232ba50ca02e5adbc7541a4b9efa7186bfdc | [
"BSD-2-Clause"
] | 1 | 2021-01-30T20:12:18.000Z | 2021-01-30T20:12:18.000Z | import geojson
import datetime
import dateutil.parser
from server import db
from sqlalchemy import desc, text
from server.models.dtos.user_dto import UserDTO, UserMappedProjectsDTO, MappedProject, UserFilterDTO, Pagination, \
UserSearchQuery, UserSearchDTO, ProjectParticipantUser, ListedUser
from server.models.post... | 44.385382 | 118 | 0.643114 | import geojson
import datetime
import dateutil.parser
from server import db
from sqlalchemy import desc, text
from server.models.dtos.user_dto import UserDTO, UserMappedProjectsDTO, MappedProject, UserFilterDTO, Pagination, \
UserSearchQuery, UserSearchDTO, ProjectParticipantUser, ListedUser
from server.models.post... | true | true |
f7257d2547d1644fe9f677f8883223e1b992288c | 7,585 | py | Python | mmdet/models/detectors/maskformer.py | ayulockin/mmdetection | 6b87ac22b8d9dea8cc28b9ce84909e6c311e6268 | [
"Apache-2.0"
] | 2 | 2021-11-27T03:30:42.000Z | 2022-01-01T05:14:18.000Z | mmdet/models/detectors/maskformer.py | Bella-ing/mmdetection | 70f6d9cfade4a2f0b198e4f64776521d181b28be | [
"Apache-2.0"
] | 1 | 2020-05-20T08:13:44.000Z | 2020-05-20T08:13:44.000Z | mmdet/models/detectors/maskformer.py | Bella-ing/mmdetection | 70f6d9cfade4a2f0b198e4f64776521d181b28be | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import mmcv
import numpy as np
from mmdet.core import INSTANCE_OFFSET
from mmdet.core.visualization import imshow_det_bboxes
from ..builder import DETECTORS, build_backbone, build_head, build_neck
from .single_stage import SingleStageDetector
@DETECTORS.register_module... | 39.921053 | 79 | 0.562162 |
import mmcv
import numpy as np
from mmdet.core import INSTANCE_OFFSET
from mmdet.core.visualization import imshow_det_bboxes
from ..builder import DETECTORS, build_backbone, build_head, build_neck
from .single_stage import SingleStageDetector
@DETECTORS.register_module()
class MaskFormer(SingleStageDetector):
... | true | true |
f7257da3da9f350d02208ba89525fe652376caa1 | 19,232 | py | Python | yaldevtools/source_code.py | libyal/libyal | 407e4710c9c11000dc45427d72bbdbdc2861c51a | [
"Apache-2.0"
] | 176 | 2015-01-11T01:57:37.000Z | 2022-03-30T05:31:33.000Z | yaldevtools/source_code.py | libyal/libyal | 407e4710c9c11000dc45427d72bbdbdc2861c51a | [
"Apache-2.0"
] | 79 | 2015-01-07T19:05:32.000Z | 2022-01-25T15:19:29.000Z | yaldevtools/source_code.py | libyal/libyal | 407e4710c9c11000dc45427d72bbdbdc2861c51a | [
"Apache-2.0"
] | 25 | 2015-07-16T13:29:00.000Z | 2022-02-12T08:15:19.000Z | # -*- coding: utf-8 -*-
"""The source code classes."""
import collections
from yaldevtools import definitions
class EnumDeclaration(object):
"""Enumeration type declaration.
Attributes:
name (str): name.
constants (dict[str, str]): constant values per name.
"""
def __init__(self, name):
"""Ini... | 31.271545 | 79 | 0.674085 |
import collections
from yaldevtools import definitions
class EnumDeclaration(object):
def __init__(self, name):
super(EnumDeclaration, self).__init__()
self.constants = collections.OrderedDict()
self.name = name
class FunctionArgument(object):
def __init__(self, argument_string):
super(Func... | true | true |
f7257dbe457fadac40393d1ec3dd31766bbf6237 | 540 | py | Python | sample_app/admin.py | imimran/inline-in-fieldset | c20568904011889001d92024c8881782a84aa00c | [
"MIT"
] | null | null | null | sample_app/admin.py | imimran/inline-in-fieldset | c20568904011889001d92024c8881782a84aa00c | [
"MIT"
] | null | null | null | sample_app/admin.py | imimran/inline-in-fieldset | c20568904011889001d92024c8881782a84aa00c | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Student, Subject
class SubjectInline(admin.TabularInline):
model = Subject
insert_after = 'name'
class StudentAdmin(admin.ModelAdmin):
fields = (
'name',
'department',
'gender',
)
inlines = [
SubjectInline,
... | 16.875 | 58 | 0.572222 | from django.contrib import admin
from .models import Student, Subject
class SubjectInline(admin.TabularInline):
model = Subject
insert_after = 'name'
class StudentAdmin(admin.ModelAdmin):
fields = (
'name',
'department',
'gender',
)
inlines = [
SubjectInline,
... | true | true |
f7257df7d21d92286f4cc0d13478da8406845b2f | 26,886 | py | Python | zipline/data/resample.py | Code37/zipline | de038dbf584980af4f30822f8e5d306bac2a44cb | [
"Apache-2.0"
] | 412 | 2017-04-30T14:35:47.000Z | 2022-03-29T02:58:33.000Z | zipline/data/resample.py | waijay1992/zipline | 8beba055aa4211dc2debc5c3083077cbd19d0bbc | [
"Apache-2.0"
] | 116 | 2017-05-15T04:45:45.000Z | 2020-05-30T19:09:00.000Z | zipline/data/resample.py | waijay1992/zipline | 8beba055aa4211dc2debc5c3083077cbd19d0bbc | [
"Apache-2.0"
] | 80 | 2017-05-03T13:17:33.000Z | 2021-02-08T15:42:09.000Z | # Copyright 2016 Quantopian, 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 agreed to in writ... | 36.6794 | 79 | 0.542699 |
from collections import OrderedDict
from abc import ABCMeta, abstractmethod
import numpy as np
import pandas as pd
from six import with_metaclass
from zipline.data._resample import (
_minute_to_session_open,
_minute_to_session_high,
_minute_to_session_low,
_minute_to_session_close,
_m... | true | true |
f725827d5a741e222353b63795ed67c9692af41b | 1,201 | py | Python | load_testing/ial2_sign_up.locustfile.py | isabella232/identity-loadtest | d915fe5920978672246a1de46b0d9530f7d38fcc | [
"CC0-1.0"
] | null | null | null | load_testing/ial2_sign_up.locustfile.py | isabella232/identity-loadtest | d915fe5920978672246a1de46b0d9530f7d38fcc | [
"CC0-1.0"
] | 1 | 2021-02-24T02:55:22.000Z | 2021-02-24T02:55:22.000Z | load_testing/ial2_sign_up.locustfile.py | isabella232/identity-loadtest | d915fe5920978672246a1de46b0d9530f7d38fcc | [
"CC0-1.0"
] | null | null | null | from locust import HttpUser, TaskSet, task, between
from common_flows import flow_ial2_proofing, flow_sign_up, flow_helper
class IAL2SignUpLoad(TaskSet):
# Preload drivers license data
license_front = flow_helper.load_fixture("mont-front.jpeg")
license_back = flow_helper.load_fixture("mont-back.jpeg")
... | 29.292683 | 70 | 0.654455 | from locust import HttpUser, TaskSet, task, between
from common_flows import flow_ial2_proofing, flow_sign_up, flow_helper
class IAL2SignUpLoad(TaskSet):
license_front = flow_helper.load_fixture("mont-front.jpeg")
license_back = flow_helper.load_fixture("mont-back.jpeg")
def on_start(self):
... | true | true |
f725827e2a3d139f12b578cfd7d4e3af8491e768 | 927 | py | Python | bin/pdbqt2pdb_ref.py | gicsaw/pdbtools | 10a9441f0345d34e90ca1c454a6aa460b7da926d | [
"MIT"
] | null | null | null | bin/pdbqt2pdb_ref.py | gicsaw/pdbtools | 10a9441f0345d34e90ca1c454a6aa460b7da926d | [
"MIT"
] | null | null | null | bin/pdbqt2pdb_ref.py | gicsaw/pdbtools | 10a9441f0345d34e90ca1c454a6aa460b7da926d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import pdbtools.ligand_tools as ligand_tools
def main():
import argparse
title_line = 'convert pdbqt to pdb using reference pdb file'
parser = argparse.ArgumentParser(description=title_line)
parser.add_argument('-i', '--input_file', required=True,
help='i... | 30.9 | 76 | 0.629989 |
import pdbtools.ligand_tools as ligand_tools
def main():
import argparse
title_line = 'convert pdbqt to pdb using reference pdb file'
parser = argparse.ArgumentParser(description=title_line)
parser.add_argument('-i', '--input_file', required=True,
help='input ligand pdbqt fil... | true | true |
f72583f1e1e8e5ca6b7b3190c8fd9abe0893dc59 | 9,848 | py | Python | pysnmp-with-texts/CISCO-HARDWARE-IP-VERIFY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/CISCO-HARDWARE-IP-VERIFY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/CISCO-HARDWARE-IP-VERIFY-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-HARDWARE-IP-VERIFY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-HARDWARE-IP-VERIFY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:59:41 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python vers... | 172.77193 | 2,096 | 0.792141 |
Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint = mibBuild... | true | true |
f72583f3abd30086f322b31d478f793386b37978 | 1,402 | py | Python | plugins/infocenteruri.py | LandGrey/taoman | 3ad45823e7af0a8a9ee6e1296446c3a6aab43fe4 | [
"MIT"
] | 207 | 2017-05-03T10:31:45.000Z | 2022-03-26T09:49:03.000Z | plugins/infocenteruri.py | the8robot/taoman | 3ad45823e7af0a8a9ee6e1296446c3a6aab43fe4 | [
"MIT"
] | 1 | 2020-03-29T03:28:29.000Z | 2020-03-29T04:41:03.000Z | plugins/infocenteruri.py | the8robot/taoman | 3ad45823e7af0a8a9ee6e1296446c3a6aab43fe4 | [
"MIT"
] | 59 | 2017-05-06T02:43:36.000Z | 2022-01-22T12:39:07.000Z | #!/usr/bin/env python
# coding:utf-8
#
"""
Copyright (c) 2017 LandGrey (https://github.com/LandGrey/taoman)
License: MIT
"""
import urllib
import requests
from lib.fun import crawl_link_handle
from lib.config import baidu_base_url, get_head, timeout, baidu_first_pattern, self_pattern, intranet_ip_pattern, \
ip_sim... | 38.944444 | 118 | 0.599857 |
import urllib
import requests
from lib.fun import crawl_link_handle
from lib.config import baidu_base_url, get_head, timeout, baidu_first_pattern, self_pattern, intranet_ip_pattern, \
ip_simple_pattern
def crawlinfocenter(domain):
domains = []
data = {'wd': 'site:{0} 信息化|网络中心'.format(domain)}
requ... | true | true |
f725848078385894b2570cd95107b891abee18ba | 7,574 | py | Python | file_hash.py | XVicarious/file_hash | ebab0151dbbd2d162742008d9088ad03a38f495e | [
"MIT"
] | null | null | null | file_hash.py | XVicarious/file_hash | ebab0151dbbd2d162742008d9088ad03a38f495e | [
"MIT"
] | 1 | 2018-10-27T09:02:13.000Z | 2018-10-27T09:02:13.000Z | file_hash.py | XVicarious/file_hash | ebab0151dbbd2d162742008d9088ad03a38f495e | [
"MIT"
] | null | null | null | """Hash your files for easy identification."""
import hashlib
import logging
import os
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from typing import Dict
from flexget import plugin
from flexget.event import event
from flexget.logger import FlexGetLogger
from .cunit import IECUnit... | 37.127451 | 115 | 0.591761 |
import hashlib
import logging
import os
from builtins import *
from typing import Dict
from flexget import plugin
from flexget.event import event
from flexget.logger import FlexGetLogger
from .cunit import IECUnit
PLUGIN_ID = 'file_hash'
log: FlexGetLogger = logging.getLogger(PLUGIN_ID)
class FileHashPlugin(ob... | true | true |
f72585050c810ea13194c609b96660990583ebbd | 2,046 | py | Python | Day-04/part2.py | archanpatkar/advent2021 | 8e0780cd28b5825af092e4ba8e3d9cd1059bce92 | [
"MIT"
] | null | null | null | Day-04/part2.py | archanpatkar/advent2021 | 8e0780cd28b5825af092e4ba8e3d9cd1059bce92 | [
"MIT"
] | null | null | null | Day-04/part2.py | archanpatkar/advent2021 | 8e0780cd28b5825af092e4ba8e3d9cd1059bce92 | [
"MIT"
] | null | null | null | import sys
sys.path.append("..")
from common import *
def parse(d):
temp = d.strip().split("\n")
first = tuple([int(n) for n in temp[0].strip().split(",")])
second = []
temp2 = []
print(temp)
for r in temp[1:]:
# print(r)
if(len(r) == 0):
second.append(tuple(temp2))... | 25.575 | 78 | 0.451124 | import sys
sys.path.append("..")
from common import *
def parse(d):
temp = d.strip().split("\n")
first = tuple([int(n) for n in temp[0].strip().split(",")])
second = []
temp2 = []
print(temp)
for r in temp[1:]:
if(len(r) == 0):
second.append(tuple(temp2))
... | true | true |
f7258523558bf650489ce11f89d5a70fe2400656 | 1,042 | py | Python | dts_test_project/dts_test_app/migrations/0001_initial.py | pvandegeer/django-tenant-schemas | 20c72782cee51a33fd5c56a0af7b2c653c1b6770 | [
"MIT"
] | 2 | 2018-08-14T07:37:06.000Z | 2018-09-27T11:20:54.000Z | dts_test_project/dts_test_app/migrations/0001_initial.py | pvandegeer/django-tenant-schemas | 20c72782cee51a33fd5c56a0af7b2c653c1b6770 | [
"MIT"
] | 1 | 2021-01-25T09:48:27.000Z | 2021-01-25T09:48:27.000Z | dts_test_project/dts_test_app/migrations/0001_initial.py | pvandegeer/django-tenant-schemas | 20c72782cee51a33fd5c56a0af7b2c653c1b6770 | [
"MIT"
] | 3 | 2018-08-14T07:37:08.000Z | 2021-04-24T07:52:00.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | 28.944444 | 114 | 0.56238 |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name... | true | true |
f7258581d63de21fec44899869d8d610223ca22b | 2,803 | py | Python | src/redgrease/cluster.py | jsam/redgrease | 245755b34bce287c63abb6624478cdf8189816b6 | [
"MIT"
] | null | null | null | src/redgrease/cluster.py | jsam/redgrease | 245755b34bce287c63abb6624478cdf8189816b6 | [
"MIT"
] | null | null | null | src/redgrease/cluster.py | jsam/redgrease | 245755b34bce287c63abb6624478cdf8189816b6 | [
"MIT"
] | null | null | null | from typing import Callable, Dict
import rediscluster
import rediscluster.exceptions
import redgrease.client
import redgrease.data
import redgrease.utils
class RedisCluster(rediscluster.RedisCluster):
"""RedisCluster client class, with support for gears features
Behaves exactly like the rediscluster.RedisC... | 32.593023 | 85 | 0.642526 | from typing import Callable, Dict
import rediscluster
import rediscluster.exceptions
import redgrease.client
import redgrease.data
import redgrease.utils
class RedisCluster(rediscluster.RedisCluster):
NODES_FLAGS = {
**rediscluster.RedisCluster.NODES_FLAGS,
**{
... | true | true |
f72587485c282a74d27d67de475830aad98af691 | 1,316 | py | Python | elpips/util.py | niopeng/elpips | 385012a2ee614c75a1631546c391039af85744f4 | [
"BSD-2-Clause"
] | 88 | 2019-06-13T10:42:26.000Z | 2022-03-30T07:36:20.000Z | elpips/util.py | niopeng/elpips | 385012a2ee614c75a1631546c391039af85744f4 | [
"BSD-2-Clause"
] | 4 | 2019-11-13T23:11:33.000Z | 2021-07-21T11:04:08.000Z | elpips/util.py | niopeng/elpips | 385012a2ee614c75a1631546c391039af85744f4 | [
"BSD-2-Clause"
] | 18 | 2019-06-10T16:31:10.000Z | 2022-01-04T03:48:57.000Z | import tensorflow as tf
import numpy as np
def switch_case_cond(cases, default_case):
if cases:
condition, effect = cases[0]
return tf.cond(condition, effect, lambda: switch_case_cond(cases[1:], default_case))
return default_case()
def switch_case_where(cases, default_case):
if cases:
condition, effect = c... | 25.803922 | 126 | 0.715046 | import tensorflow as tf
import numpy as np
def switch_case_cond(cases, default_case):
if cases:
condition, effect = cases[0]
return tf.cond(condition, effect, lambda: switch_case_cond(cases[1:], default_case))
return default_case()
def switch_case_where(cases, default_case):
if cases:
condition, effect = c... | true | true |
f72587bcc4673fe9fd1a8a3ffec34ab4d833f88b | 5,113 | py | Python | src/estimagic/benchmarking/run_benchmark.py | PaulBehler/estimagic | c14f743986262d508e55738c90737cb504fe987b | [
"MIT"
] | 7 | 2019-05-11T07:19:46.000Z | 2019-05-31T07:03:13.000Z | src/estimagic/benchmarking/run_benchmark.py | PaulBehler/estimagic | c14f743986262d508e55738c90737cb504fe987b | [
"MIT"
] | 14 | 2019-05-04T14:15:52.000Z | 2019-06-10T11:45:27.000Z | src/estimagic/benchmarking/run_benchmark.py | PaulBehler/estimagic | c14f743986262d508e55738c90737cb504fe987b | [
"MIT"
] | 1 | 2019-05-21T08:44:37.000Z | 2019-05-21T08:44:37.000Z | """Functions to create, run and visualize optimization benchmarks.
TO-DO:
- Add other benchmark sets:
- finish medium scale problems from https://arxiv.org/pdf/1710.11005.pdf, Page 34.
- add scalar problems from https://github.com/AxelThevenot
- Add option for deterministic noise or wiggle.
"""
from pathlib i... | 37.050725 | 88 | 0.643067 | from pathlib import Path
import numpy as np
from estimagic import batch_evaluators
from estimagic.logging.read_log import read_optimization_histories
from estimagic.optimization.optimize import minimize
def run_benchmark(
problems,
optimize_options,
logging_directory,
*,
batch_evaluator="joblib",... | true | true |
f725895b361675e864ed1a5ce6a8bc79a831c085 | 6,172 | py | Python | Data_Handling/Data_analyze.py | KristofferLM96/TsetlinMachine-GO | 926091fc70042abe5a67230932398bdab2c46328 | [
"MIT"
] | 2 | 2020-02-27T16:22:08.000Z | 2020-03-22T11:04:35.000Z | Data_Handling/Data_analyze.py | KristofferLM96/TsetlinMachine-GO | 926091fc70042abe5a67230932398bdab2c46328 | [
"MIT"
] | null | null | null | Data_Handling/Data_analyze.py | KristofferLM96/TsetlinMachine-GO | 926091fc70042abe5a67230932398bdab2c46328 | [
"MIT"
] | null | null | null | # -----------------------------------------------
# ................. LIBRARIES ...................
# -----------------------------------------------
import glob
import os
import time
import numpy as np
# -----------------------------------------------
# ............. GLOBAL VARIABLES ................
# -------------... | 31.814433 | 108 | 0.487362 |
import glob
import os
import time
import numpy as np
name = "100_9x9Aya"
file_name = name + "_binary.txt"
binary_path = "Data/Binary/" + file_name
original_path = "/home/kristoffer/Documents/Data/Original/9x9_10k_r104_144x20k/*"
encoding = "UTF-8"
multiple_files = True
unique_list = []
original_list = []
... | true | true |
f725898cfbcf257a6620878c85d91d75a4f7b6bd | 11,001 | py | Python | SBaaS_rnasequencing/stage01_rnasequencing_genesCountTable_io.py | dmccloskey/SBaaS_rnasequencing | 521ad0b671b0bca02e9cebfc1b372f2265955418 | [
"MIT"
] | null | null | null | SBaaS_rnasequencing/stage01_rnasequencing_genesCountTable_io.py | dmccloskey/SBaaS_rnasequencing | 521ad0b671b0bca02e9cebfc1b372f2265955418 | [
"MIT"
] | null | null | null | SBaaS_rnasequencing/stage01_rnasequencing_genesCountTable_io.py | dmccloskey/SBaaS_rnasequencing | 521ad0b671b0bca02e9cebfc1b372f2265955418 | [
"MIT"
] | null | null | null | #system
import json
#sbaas
from .stage01_rnasequencing_genesCountTable_query import stage01_rnasequencing_genesCountTable_query
from .stage01_rnasequencing_analysis_query import stage01_rnasequencing_analysis_query
from SBaaS_base.sbaas_template_io import sbaas_template_io
# Resources
from io_utilities.base_importData... | 50.463303 | 248 | 0.634942 |
import json
from .stage01_rnasequencing_genesCountTable_query import stage01_rnasequencing_genesCountTable_query
from .stage01_rnasequencing_analysis_query import stage01_rnasequencing_analysis_query
from SBaaS_base.sbaas_template_io import sbaas_template_io
from io_utilities.base_importData import base_importData
... | true | true |
f7258a45bcc7583012e19070d9419ded10110a6e | 2,480 | py | Python | redunlive/utils.py | nmaekawa/redunlive | 3f1830d605c46a300d028a32b564d803964f2384 | [
"Apache-2.0"
] | null | null | null | redunlive/utils.py | nmaekawa/redunlive | 3f1830d605c46a300d028a32b564d803964f2384 | [
"Apache-2.0"
] | null | null | null | redunlive/utils.py | nmaekawa/redunlive | 3f1830d605c46a300d028a32b564d803964f2384 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import sys
import platform
import requests
from requests.auth import HTTPBasicAuth
from . import __version__
from . import log
def clean_name( name ):
""" replaces non-alpha with underscores '_'
and set the string to lower case
"""
return re.sub( '[^0-9a-zA-Z]+... | 32.207792 | 80 | 0.594355 |
import re
import sys
import platform
import requests
from requests.auth import HTTPBasicAuth
from . import __version__
from . import log
def clean_name( name ):
return re.sub( '[^0-9a-zA-Z]+', '_', name ).lower()
def pull_data( url, creds=None):
headers = {
'User-Agent': default_useragent(),... | true | true |
f7258af14dcf0fa82efc690560fcea365ab3ef09 | 4,999 | py | Python | cameras_to_albums.py | brandoconnor/flickr-album-per-camera | 358c90cded12c6c9ecb9f8ae289e005f172d30e2 | [
"Apache-2.0"
] | null | null | null | cameras_to_albums.py | brandoconnor/flickr-album-per-camera | 358c90cded12c6c9ecb9f8ae289e005f172d30e2 | [
"Apache-2.0"
] | 1 | 2016-02-12T02:25:19.000Z | 2016-02-13T00:07:46.000Z | cameras_to_albums.py | brandoconnor/flickr-album-per-camera | 358c90cded12c6c9ecb9f8ae289e005f172d30e2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
A simple script to organize photos into albums named by their camera source.
For me, this is useful for cycling through only high quality photos on my TV
hooked up to a chromecast.
"""
import argparse
import flickrapi
def auth_flickr(api_key, api_secret):
"""Authenticate user to flick... | 46.719626 | 114 | 0.595319 |
import argparse
import flickrapi
def auth_flickr(api_key, api_secret):
flickr = flickrapi.FlickrAPI(api_key, api_secret, format='parsed-json')
flickr.authenticate_via_browser(perms='write')
return flickr
def get_user_id(flickr, user):
user_data = flickr.people.findByUsername(username=user)
r... | true | true |
f7258c968558839fb8aa4aaba0600d037324ede1 | 2,204 | py | Python | cheritest/trunk/tests/alu/test_msub_ex.py | tupipa/beri | cef1b41d52592cfa7454ddf59f9f2994e447cd66 | [
"Apache-2.0"
] | 36 | 2015-05-29T16:47:19.000Z | 2022-02-08T21:16:26.000Z | cheritest/trunk/tests/alu/test_msub_ex.py | tupipa/beri | cef1b41d52592cfa7454ddf59f9f2994e447cd66 | [
"Apache-2.0"
] | 1 | 2015-10-14T13:05:21.000Z | 2015-10-19T20:34:03.000Z | cheritest/trunk/tests/alu/test_msub_ex.py | tupipa/beri | cef1b41d52592cfa7454ddf59f9f2994e447cd66 | [
"Apache-2.0"
] | 15 | 2015-06-11T07:10:58.000Z | 2021-06-18T05:14:54.000Z | #-
# Copyright (c) 2015 Michael Roe
# All rights reserved.
#
# This software was developed by the University of Cambridge Computer
# Laboratory as part of the Rigorous Engineering of Mainstream Systems (REMS)
# project, funded by EPSRC grant EP/K008528/1.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open System... | 41.584906 | 166 | 0.748185 |
from beritest_tools import BaseBERITestCase
from nose.plugins.attrib import attr
class test_msub_ex(BaseBERITestCase):
@attr('ignorebadex')
@attr('madd')
def test_msub_ex_1(self):
self.assertRegisterEqual(self.MIPS.a0, 0xfffffffffffffffa, "MSUB of a value that was not a ... | true | true |
f7258cce35cf6a9ce718c2c71ffc2151fcba6ee2 | 498 | py | Python | contentsummary/urls.py | Bobstin/itcsummary | 259d8f64e415a1c7cbc926752c717e307c09953f | [
"MIT"
] | null | null | null | contentsummary/urls.py | Bobstin/itcsummary | 259d8f64e415a1c7cbc926752c717e307c09953f | [
"MIT"
] | 5 | 2021-02-27T13:23:58.000Z | 2021-09-22T17:39:19.000Z | contentsummary/urls.py | Bobstin/itcsummary | 259d8f64e415a1c7cbc926752c717e307c09953f | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^next/(?P<priornumber>[0-9]+)/$', views.nextSession, name='nextSession'),
url(r'^all/$', views.allSessions, name='allSessions'),
url(r'^allpt1/$', views.allSessionspt1, name='allSessionspt1'),
url(r'^allpt2/$', views.allSession... | 41.5 | 99 | 0.670683 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^next/(?P<priornumber>[0-9]+)/$', views.nextSession, name='nextSession'),
url(r'^all/$', views.allSessions, name='allSessions'),
url(r'^allpt1/$', views.allSessionspt1, name='allSessionspt1'),
url(r'^allpt2/$', views.allSession... | true | true |
f7258cd44fa3033315e86b9b007b80c34183601d | 71,980 | py | Python | nova/compute/resource_tracker.py | aspiers/nova | e8b6b0bc78ec229803d1d27f8a4706e2c425bd77 | [
"Apache-2.0"
] | 1 | 2021-12-27T00:47:30.000Z | 2021-12-27T00:47:30.000Z | nova/compute/resource_tracker.py | aspiers/nova | e8b6b0bc78ec229803d1d27f8a4706e2c425bd77 | [
"Apache-2.0"
] | null | null | null | nova/compute/resource_tracker.py | aspiers/nova | e8b6b0bc78ec229803d1d27f8a4706e2c425bd77 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 46.408769 | 79 | 0.621367 |
import collections
import copy
from keystoneauth1 import exceptions as ks_exc
import os_resource_classes as orc
from oslo_log import log as logging
from oslo_serialization import jsonutils
import retrying
from nova.compute import claims
from nova.compute import monitors
from nova.compute import stats a... | true | true |
f7258d9ad8ec1ffdd9a1d4a476dabdc315bbf560 | 5,448 | py | Python | synthesizer/models/custom_decoder.py | Khizar-Ali/Lip2Wav | 07f056b3468ca660823830680bf25bdd42034f9e | [
"MIT"
] | 541 | 2020-05-14T05:56:31.000Z | 2022-03-30T03:34:55.000Z | synthesizer/models/custom_decoder.py | Khizar-Ali/Lip2Wav | 07f056b3468ca660823830680bf25bdd42034f9e | [
"MIT"
] | 36 | 2020-05-14T06:00:31.000Z | 2022-03-10T06:13:44.000Z | synthesizer/models/custom_decoder.py | Khizar-Ali/Lip2Wav | 07f056b3468ca660823830680bf25bdd42034f9e | [
"MIT"
] | 123 | 2020-05-19T02:43:47.000Z | 2022-03-26T11:28:13.000Z | from __future__ import absolute_import, division, print_function
import collections
import tensorflow as tf
from synthesizer.models.helpers import TacoTestHelper, TacoTrainingHelper
from tensorflow.contrib.seq2seq.python.ops import decoder
from tensorflow.contrib.seq2seq.python.ops import helper as helper_py
from tenso... | 36.810811 | 101 | 0.752019 | from __future__ import absolute_import, division, print_function
import collections
import tensorflow as tf
from synthesizer.models.helpers import TacoTestHelper, TacoTrainingHelper
from tensorflow.contrib.seq2seq.python.ops import decoder
from tensorflow.contrib.seq2seq.python.ops import helper as helper_py
from tenso... | true | true |
f7258fa1fd9ffacbfd6a1a0cc0f2cd988adbdb32 | 3,381 | py | Python | Server_Code/database.py | PUT-PTM/2019_SmartAttendance | cab58f3f355c07d3dfd4c73c8adb4c7bbf6d676c | [
"MIT"
] | 1 | 2019-03-13T16:00:32.000Z | 2019-03-13T16:00:32.000Z | Server_Code/database.py | PUT-PTM/2019_SmartAttendance | cab58f3f355c07d3dfd4c73c8adb4c7bbf6d676c | [
"MIT"
] | null | null | null | Server_Code/database.py | PUT-PTM/2019_SmartAttendance | cab58f3f355c07d3dfd4c73c8adb4c7bbf6d676c | [
"MIT"
] | 1 | 2021-07-10T08:27:21.000Z | 2021-07-10T08:27:21.000Z | from datetime import datetime
import json
from pathlib import Path
import pymssql
config_json: dict = json.loads(Path('config.json').read_text())
# Connecting to database
def connect():
global config_json
# Connect to Microsoft SQL server
conn = pymssql.connect(
server=config_json['server'],
... | 25.613636 | 91 | 0.540964 | from datetime import datetime
import json
from pathlib import Path
import pymssql
config_json: dict = json.loads(Path('config.json').read_text())
def connect():
global config_json
conn = pymssql.connect(
server=config_json['server'],
user=config_json['user'],
password=config_js... | true | true |
f725901ae4990c796dfc0c6fd9dcacb4bed91c78 | 3,385 | py | Python | examples/basic_operations/update_ad_group.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/update_ad_group.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/update_ad_group.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 32.548077 | 79 | 0.676809 |
import argparse
import sys
from google.ads.googleads.client import GoogleAdsClient
from google.ads.googleads.errors import GoogleAdsException
from google.api_core import protobuf_helpers
def main(client, customer_id, ad_group_id, cpc_bid_micro_amount):
ad_group_service = client.get_service("AdGr... | true | true |
f72590d6e6483328b9562e5788fc07feb3ad4594 | 11,628 | py | Python | tests/suite.py | dannielarriola/uai-coursebuilder | fbd440a8bfe1a928ac52985aea2949d5e91ad203 | [
"Apache-2.0"
] | null | null | null | tests/suite.py | dannielarriola/uai-coursebuilder | fbd440a8bfe1a928ac52985aea2949d5e91ad203 | [
"Apache-2.0"
] | 27 | 2016-08-31T19:04:46.000Z | 2016-09-29T00:22:32.000Z | tests/suite.py | dannielarriola/uai-coursebuilder | fbd440a8bfe1a928ac52985aea2949d5e91ad203 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 36.566038 | 80 | 0.689456 |
__author__ = 'Sean Lip'
import argparse
import cStringIO
import logging
import os
import shutil
import sys
import unittest
import task_queue
import webtest
import appengine_config
from tools.etl import etl
from google.appengine.api.search import simple_search_stub
from google.appengine.datastore imp... | true | true |
f7259138e078865f2f6c44a93538b382ee2f400a | 786 | py | Python | pyleecan/Methods/Output/OutElec/get_Nr.py | tobsen2code/pyleecan | 5b1ded9e389e0c79ed7b7c878b6e939f2d9962e9 | [
"Apache-2.0"
] | 5 | 2020-03-05T15:22:39.000Z | 2022-03-02T15:26:08.000Z | pyleecan/Methods/Output/OutElec/get_Nr.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | 8 | 2020-07-09T07:43:01.000Z | 2022-03-08T12:52:06.000Z | pyleecan/Methods/Output/OutElec/get_Nr.py | Eomys/Pyleecan | 4d7f0cbabf0311006963e7a2f435db2ecd901118 | [
"Apache-2.0"
] | 4 | 2019-12-23T12:38:01.000Z | 2022-01-07T10:47:48.000Z | from numpy import ones
def get_Nr(self, Time=None):
"""Create speed in function of time vector Nr
Parameters
----------
self : OutElec
An OutElec object
Time : Data
a time axis (SciDataTool Data object)
Returns
-------
Nr: ndarray
speed in function of time
... | 23.818182 | 84 | 0.611959 | from numpy import ones
def get_Nr(self, Time=None):
if Time is None:
if self.axes_dict is not None and "time" in self.axes_dict:
Time = self.axes_dict["time"]
else:
raise Exception('You must define "time" property before calling get_Nr')
if self.OP.get_N0() is None:
... | true | true |
f72595be695d8aadf33d417466be973d11af82cd | 21,863 | py | Python | qkeras/qoctave.py | thaarres/qkeras | a04bfe65a144ef6dd0ca0880866ef6109c3638fc | [
"Apache-2.0"
] | 1 | 2019-12-08T16:22:21.000Z | 2019-12-08T16:22:21.000Z | qkeras/qoctave.py | Athena-INT/qkeras | 4cd7bb948bca11507d124cdddc3afda4956a72db | [
"Apache-2.0"
] | null | null | null | qkeras/qoctave.py | Athena-INT/qkeras | 4cd7bb948bca11507d124cdddc3afda4956a72db | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | 36.806397 | 80 | 0.634725 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import re
from keras.layers import Activation
from keras.layers import Add
from keras.layers import AveragePooling2D
from keras.layers import Conv2D
from keras.layers import SeparableConv2D
fro... | true | true |
f7259600ce77f1327a75cfc7ad33fc54ddf8e263 | 261 | py | Python | daily_work/daily_work/doctype/daily_default_setting/daily_default_setting.py | muirawachanga/mwai | 1a95cba5bc6368361fc48984ba05307ae4093ead | [
"MIT"
] | null | null | null | daily_work/daily_work/doctype/daily_default_setting/daily_default_setting.py | muirawachanga/mwai | 1a95cba5bc6368361fc48984ba05307ae4093ead | [
"MIT"
] | null | null | null | daily_work/daily_work/doctype/daily_default_setting/daily_default_setting.py | muirawachanga/mwai | 1a95cba5bc6368361fc48984ba05307ae4093ead | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2019, steve and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class DailyDefaultSetting(Document):
pass
| 23.727273 | 49 | 0.785441 |
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class DailyDefaultSetting(Document):
pass
| true | true |
f7259615a162f1f9b8997248b81998d51618e2f1 | 1,384 | py | Python | cli.py | stesla/arxtools | 7f1a3b973e3d78faed4085d547b7d27ebcd9838d | [
"MIT"
] | null | null | null | cli.py | stesla/arxtools | 7f1a3b973e3d78faed4085d547b7d27ebcd9838d | [
"MIT"
] | null | null | null | cli.py | stesla/arxtools | 7f1a3b973e3d78faed4085d547b7d27ebcd9838d | [
"MIT"
] | null | null | null | import click
import configparser
import json
import sys
from arxtools import export_clues, fetch_clues
from arxtools.clue import Clue
@click.group()
def cli():
pass
def get_character_info(name):
config = configparser.ConfigParser()
config.read('arxtools.ini')
try:
return config[name.lower()]... | 24.714286 | 68 | 0.682803 | import click
import configparser
import json
import sys
from arxtools import export_clues, fetch_clues
from arxtools.clue import Clue
@click.group()
def cli():
pass
def get_character_info(name):
config = configparser.ConfigParser()
config.read('arxtools.ini')
try:
return config[name.lower()]... | true | true |
f7259776fb98e992d885bf99cf4adf99f37e8745 | 8,549 | py | Python | gui/qt/utxo_list.py | ComputerCraftr/openswap | 7de04aa80dab79bebe4b64483011dad70a48694c | [
"MIT"
] | 16 | 2018-11-05T13:19:02.000Z | 2021-04-06T12:11:49.000Z | gui/qt/utxo_list.py | ComputerCraftr/openswap | 7de04aa80dab79bebe4b64483011dad70a48694c | [
"MIT"
] | 11 | 2018-11-11T08:56:03.000Z | 2018-12-08T02:31:57.000Z | gui/qt/utxo_list.py | ComputerCraftr/openswap | 7de04aa80dab79bebe4b64483011dad70a48694c | [
"MIT"
] | 5 | 2019-01-07T13:45:05.000Z | 2020-06-12T14:13:21.000Z | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... | 52.771605 | 138 | 0.63177 |
from .util import *
from electroncash.i18n import _
class UTXOList(MyTreeWidget):
filter_columns = [0, 2]
def __init__(self, parent=None):
MyTreeWidget.__init__(self, parent, self.create_menu, [ _('Address'), _('Label'), _('Amount'), _('Height'), _('Output point')], 1)
... | true | true |
f72597acf84a319c1cde2a9c2a80f3c7b7cfc2a4 | 984 | py | Python | src/platform/avr/pmfeatures.py | ArtemovSA/PyMite | a22fbae773b285ccf4993905a46dd396cb762f69 | [
"OLDAP-2.6",
"Python-2.0"
] | 51 | 2015-03-24T07:53:03.000Z | 2021-08-06T12:55:53.000Z | src/platform/avr/pmfeatures.py | ArtemovSA/PyMite | a22fbae773b285ccf4993905a46dd396cb762f69 | [
"OLDAP-2.6",
"Python-2.0"
] | null | null | null | src/platform/avr/pmfeatures.py | ArtemovSA/PyMite | a22fbae773b285ccf4993905a46dd396cb762f69 | [
"OLDAP-2.6",
"Python-2.0"
] | 15 | 2015-04-09T14:17:27.000Z | 2022-01-26T02:42:47.000Z | # This file is Copyright 2010 Dean Hall.
#
# This file is part of the Python-on-a-Chip program.
# Python-on-a-Chip is free software: you can redistribute it and/or modify
# it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1.
#
# Python-on-a-Chip is distributed in the hope that it will be useful,
# ... | 32.8 | 74 | 0.707317 |
PM_FEATURES = {
"HAVE_PRINT": True,
"HAVE_GC": True,
"HAVE_FLOAT": False,
"HAVE_DEL": True,
"HAVE_IMPORTS": True,
"HAVE_DEFAULTARGS": True,
"HAVE_REPLICATION": True,
"HAVE_CLASSES": False,
"HAVE_ASSERT": False,
"HAVE_GENERATORS": False,
"HAVE_BACKTICK": True,
... | true | true |
f7259813b4e802d256d946467bf98359af8d5554 | 2,970 | py | Python | ally/Order/tests/PricingConstruction.py | jpwatt/PyAlly | 463ac0ad22df7dd79456c58ab8da4d378427983c | [
"MIT"
] | 2 | 2021-02-28T22:02:38.000Z | 2021-12-20T19:00:25.000Z | ally/Order/tests/PricingConstruction.py | jpwatt/PyAlly | 463ac0ad22df7dd79456c58ab8da4d378427983c | [
"MIT"
] | null | null | null | ally/Order/tests/PricingConstruction.py | jpwatt/PyAlly | 463ac0ad22df7dd79456c58ab8da4d378427983c | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Brett Graves
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge,... | 23.385827 | 80 | 0.66835 |
import xml.etree.ElementTree as ET
import unittest
from ..classes import *
from .classes import *
from ..order import Order
class TestPricingConstruction(unittest.TestCase):
def test_market_construction(self):
p = Market()
self.assertEqual(
p.attributes,
{'Typ':'1'},
"Should h... | true | true |
f72598b7fb1cec8183f6a3b3b326c48b968194b9 | 2,843 | py | Python | starvine/bvcopula/tests/test_freeze_params.py | wgurecky/StarVine | b952a88eeaff476484ba6a26420cfe4ef575d162 | [
"BSD-3-Clause"
] | 12 | 2018-10-04T06:15:13.000Z | 2020-01-08T03:32:30.000Z | starvine/bvcopula/tests/test_freeze_params.py | wgurecky/StarVine | b952a88eeaff476484ba6a26420cfe4ef575d162 | [
"BSD-3-Clause"
] | 25 | 2017-08-29T06:28:37.000Z | 2020-10-16T23:56:57.000Z | starvine/bvcopula/tests/test_freeze_params.py | wgurecky/StarVine | b952a88eeaff476484ba6a26420cfe4ef575d162 | [
"BSD-3-Clause"
] | 3 | 2017-04-08T20:19:09.000Z | 2020-01-09T20:01:02.000Z | ##
# \brief Test ability to determine best fit copula via AIC
from __future__ import print_function, division
from starvine.bvcopula.pc_base import PairCopula
import unittest
import numpy as np
import os
pwd_ = os.getcwd()
dataDir = pwd_ + "/tests/data/"
np.random.seed(123)
class TestGaussFrozen(unittest.TestCase):
... | 35.098765 | 86 | 0.651425 |
from __future__ import print_function, division
from starvine.bvcopula.pc_base import PairCopula
import unittest
import numpy as np
import os
pwd_ = os.getcwd()
dataDir = pwd_ + "/tests/data/"
np.random.seed(123)
class TestGaussFrozen(unittest.TestCase):
@classmethod
def setUpClass(self):
np.random.s... | true | true |
f7259984a8976fd2deb189a6e90d3aaeabfca3d9 | 1,402 | py | Python | source/appModules/totalcmd.py | oleguldberg/nvda | 05f55ff146ef8ba481a2de4f1bcf187200474cea | [
"bzip2-1.0.6"
] | 1,592 | 2015-11-10T12:05:44.000Z | 2022-03-31T11:50:40.000Z | source/appModules/totalcmd.py | oleguldberg/nvda | 05f55ff146ef8ba481a2de4f1bcf187200474cea | [
"bzip2-1.0.6"
] | 9,479 | 2015-11-10T20:56:48.000Z | 2022-03-31T23:51:30.000Z | source/appModules/totalcmd.py | oleguldberg/nvda | 05f55ff146ef8ba481a2de4f1bcf187200474cea | [
"bzip2-1.0.6"
] | 682 | 2015-11-10T11:19:23.000Z | 2022-03-31T07:51:29.000Z | #appModules/totalcmd.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2012 NVDA Contributors
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
import appModuleHandler
from NVDAObjects.IAccessible import IAccessible
import speech
import controlTypes
import... | 28.04 | 73 | 0.752496 |
import appModuleHandler
from NVDAObjects.IAccessible import IAccessible
import speech
import controlTypes
import ui
oldActivePannel=0
class AppModule(appModuleHandler.AppModule):
def chooseNVDAObjectOverlayClasses(self, obj, clsList):
if obj.windowClassName in ("TMyListBox", "TMyListBox.UnicodeClass"):
c... | true | true |
f7259a6ab0d551d886b30961db6d5aff508bdecb | 772 | py | Python | scripts/plotting/reprocessed_kccg_samples_pca/main.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | null | null | null | scripts/plotting/reprocessed_kccg_samples_pca/main.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | 21 | 2021-03-09T06:35:59.000Z | 2022-02-21T22:56:15.000Z | scripts/plotting/reprocessed_kccg_samples_pca/main.py | populationgenomics/ancestry | faf6fd4bc3a1f8b2a2adb7e59cf584d4bfdf79e6 | [
"MIT"
] | null | null | null | """Entry point for the analysis runner."""
import os
import sys
import hail as hl
import hailtop.batch as hb
from analysis_runner import dataproc
OUTPUT = os.getenv('OUTPUT')
assert OUTPUT
hl.init(default_reference='GRCh38')
POP = sys.argv[1] if len(sys.argv) > 1 else 'nfe'
service_backend = hb.ServiceBackend(
... | 24.125 | 86 | 0.727979 |
import os
import sys
import hail as hl
import hailtop.batch as hb
from analysis_runner import dataproc
OUTPUT = os.getenv('OUTPUT')
assert OUTPUT
hl.init(default_reference='GRCh38')
POP = sys.argv[1] if len(sys.argv) > 1 else 'nfe'
service_backend = hb.ServiceBackend(
billing_project=os.getenv('HAIL_BILLING_PR... | true | true |
f7259b305c1ad5cae4a9beae16737854d8e966c3 | 7,804 | py | Python | botstory/ast/story_context/__init__.py | botstory/bot-story | 9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3 | [
"MIT"
] | 5 | 2017-01-14T13:42:13.000Z | 2021-07-27T21:52:04.000Z | botstory/ast/story_context/__init__.py | botstory/bot-story | 9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3 | [
"MIT"
] | 235 | 2016-11-07T23:33:28.000Z | 2018-03-13T11:27:33.000Z | botstory/ast/story_context/__init__.py | hyzhak/bot-story | 9c5b2fc7f7a14dbd467d70f60d5ba855ef89dac3 | [
"MIT"
] | 5 | 2017-01-14T13:42:14.000Z | 2020-11-06T08:33:20.000Z | from botstory import matchers, utils
from botstory.ast import callable, forking, loop
from botstory.ast.story_context import reducers
from botstory.utils import advanced_json_encoder
import numbers
import logging
import uuid
logger = logging.getLogger(__name__)
class MissedStoryPart(Exception):
pass
class Sto... | 32.381743 | 103 | 0.631471 | from botstory import matchers, utils
from botstory.ast import callable, forking, loop
from botstory.ast.story_context import reducers
from botstory.utils import advanced_json_encoder
import numbers
import logging
import uuid
logger = logging.getLogger(__name__)
class MissedStoryPart(Exception):
pass
class Sto... | true | true |
f7259b4e1f74cc2b78fa2fe6a806234b94c86cc1 | 6,467 | py | Python | scd_manager.py | gavinlive/scd-data-manager | 570b67bacb4bf17f0b49c5875933f233ddd76e6c | [
"MIT"
] | null | null | null | scd_manager.py | gavinlive/scd-data-manager | 570b67bacb4bf17f0b49c5875933f233ddd76e6c | [
"MIT"
] | 1 | 2020-06-09T08:48:01.000Z | 2020-06-09T09:23:07.000Z | scd_manager.py | gavinlive/scd-data-manager | 570b67bacb4bf17f0b49c5875933f233ddd76e6c | [
"MIT"
] | null | null | null | import os, sys
import pydicom as pyd
import matplotlib.pyplot as plt
import collections
import pandas as pd
PatientRecord = collections.namedtuple('PatientRecord', ['patient_id', 'image_folder', 'original_id', 'gender', 'age', 'pathology', 'all_scans', 'scans', 'scans_list', 'scans_total'])
PatientScans = collections... | 44.6 | 183 | 0.598113 | import os, sys
import pydicom as pyd
import matplotlib.pyplot as plt
import collections
import pandas as pd
PatientRecord = collections.namedtuple('PatientRecord', ['patient_id', 'image_folder', 'original_id', 'gender', 'age', 'pathology', 'all_scans', 'scans', 'scans_list', 'scans_total'])
PatientScans = collections... | true | true |
f7259c70b3269cebc23b86955129c52126b5c426 | 587 | py | Python | Python1/python1Homework/input_counter1.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | Python1/python1Homework/input_counter1.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | Python1/python1Homework/input_counter1.py | ceeblet/OST_PythonCertificationTrack | 042e0ce964bc88b3f4132dcbd7e06c5f504eae34 | [
"MIT"
] | null | null | null | #!/usr/local/bin/python3
"""input_counter.py"""
myset = set()
mydict = {}
mysetlength = len(myset)
while True:
text = input("Enter a line (or Enter to quit): ")
if not text:
break
for punc in ",?;.":
text = text.replace(punc, "")
textwords = (text.lower().split())
for word in textwo... | 26.681818 | 53 | 0.584327 |
myset = set()
mydict = {}
mysetlength = len(myset)
while True:
text = input("Enter a line (or Enter to quit): ")
if not text:
break
for punc in ",?;.":
text = text.replace(punc, "")
textwords = (text.lower().split())
for word in textwords:
myset.add(word)
newsetleng... | true | true |
f7259ef31d09ee215158684c34454fabb4e5926d | 614 | py | Python | aws-auth0-auth/helloWorld.py | skarlekar/ms-auth-tutorials | 0de172817e54533be93700de19028cfa8757861f | [
"MIT"
] | null | null | null | aws-auth0-auth/helloWorld.py | skarlekar/ms-auth-tutorials | 0de172817e54533be93700de19028cfa8757861f | [
"MIT"
] | 1 | 2021-06-01T21:41:36.000Z | 2021-06-01T21:41:36.000Z | aws-auth0-auth/helloWorld.py | skarlekar/ms-auth-tutorials | 0de172817e54533be93700de19028cfa8757861f | [
"MIT"
] | 1 | 2017-10-26T15:08:40.000Z | 2017-10-26T15:08:40.000Z | """Simple helloWorld service."""
import json
def sayHello(event, context):
"""Return a message in the response body."""
print('Event is: {}'.format(json.dumps(event)))
body = {
"message": "Hello! Your Auth0 authorized function executed successfully!"
}
response = {
"statusCode": 2... | 22.740741 | 81 | 0.599349 | import json
def sayHello(event, context):
print('Event is: {}'.format(json.dumps(event)))
body = {
"message": "Hello! Your Auth0 authorized function executed successfully!"
}
response = {
"statusCode": 200,
"body": json.dumps(body)
}
return response
# integr... | true | true |
f7259f1cbf5a3448b4489597dc832795cc8d1b52 | 9,120 | py | Python | fuji_server/models/data_provenance.py | vemonet/fuji | 92aabcb58d76a58981c677bcf0da8e57309c6096 | [
"MIT"
] | null | null | null | fuji_server/models/data_provenance.py | vemonet/fuji | 92aabcb58d76a58981c677bcf0da8e57309c6096 | [
"MIT"
] | null | null | null | fuji_server/models/data_provenance.py | vemonet/fuji | 92aabcb58d76a58981c677bcf0da8e57309c6096 | [
"MIT"
] | null | null | null | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from fuji_server.models.base_model_ import Model
from fuji_server.models.data_provenance_output import DataProvenanceOutput # noqa: F401,E501
from fuji_server.models.d... | 31.448276 | 311 | 0.639035 |
from __future__ import absolute_import
from datetime import date, datetime
from typing import List, Dict
from fuji_server.models.base_model_ import Model
from fuji_server.models.data_provenance_output import DataProvenanceOutput
from fuji_server.models.debug import Debug
from fuji_server.models.fair_result_... | true | true |
f725a0d77d7b829ac919d0eaca76f246b6e73be7 | 43,643 | py | Python | dbaas/maintenance/migrations/0030_auto__add_field_maintenance_disable_alarms.py | didindinn/database-as-a-service | 747de31ff8546f7874ddd654af860e130afd17a0 | [
"BSD-3-Clause"
] | 303 | 2015-01-08T10:35:54.000Z | 2022-02-28T08:54:06.000Z | dbaas/maintenance/migrations/0030_auto__add_field_maintenance_disable_alarms.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 124 | 2015-01-14T12:56:15.000Z | 2022-03-22T20:45:11.000Z | dbaas/maintenance/migrations/0030_auto__add_field_maintenance_disable_alarms.py | nouraellm/database-as-a-service | 5e655c9347bea991b7218a01549f5e44f161d7be | [
"BSD-3-Clause"
] | 110 | 2015-01-02T11:59:48.000Z | 2022-02-28T08:54:06.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Maintenance.disable_alarms'
db.add_column(u'maintenance_m... | 97.200445 | 227 | 0.578512 |
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.add_column(u'maintenance_maintenance', 'disable_alarms',
self.gf('djan... | true | true |
f725a15222a68089d26599b0bfbcfc3a016ae93b | 1,466 | py | Python | _action_files/nb2post.py | inc0/fastpages | 28603b7c6f38f83eea715ab12d71895078dbff9a | [
"Apache-2.0"
] | null | null | null | _action_files/nb2post.py | inc0/fastpages | 28603b7c6f38f83eea715ab12d71895078dbff9a | [
"Apache-2.0"
] | null | null | null | _action_files/nb2post.py | inc0/fastpages | 28603b7c6f38f83eea715ab12d71895078dbff9a | [
"Apache-2.0"
] | null | null | null | """Converts Jupyter Notebooks to Jekyll compliant blog posts"""
from datetime import datetime
import re, os, logging
from nbdev import export2html
from nbdev.export2html import Config, Path, _re_digits, _to_html, _re_block_notes
from fast_template import rename_for_jekyll
warnings = set()
# Modify the naming proc... | 39.621622 | 100 | 0.723056 | from datetime import datetime
import re, os, logging
from nbdev import export2html
from nbdev.export2html import Config, Path, _re_digits, _to_html, _re_block_notes
from fast_template import rename_for_jekyll
warnings = set()
def _nb2htmlfname(nb_path, dest=None):
fname = rename_for_jekyll(nb_path, warnings... | true | true |
f725a1d093a3821295e1aa148bb4213f8b3be699 | 7,204 | py | Python | Chapter05/stock_trading_visual_continuous_env.py | harinipsamy/Tensorflow-2-Reinforcement-Learning-Cookbook | b8858554e4c819c96de10c100f8213ab41561c69 | [
"MIT"
] | null | null | null | Chapter05/stock_trading_visual_continuous_env.py | harinipsamy/Tensorflow-2-Reinforcement-Learning-Cookbook | b8858554e4c819c96de10c100f8213ab41561c69 | [
"MIT"
] | null | null | null | Chapter05/stock_trading_visual_continuous_env.py | harinipsamy/Tensorflow-2-Reinforcement-Learning-Cookbook | b8858554e4c819c96de10c100f8213ab41561c69 | [
"MIT"
] | 1 | 2021-03-27T18:35:14.000Z | 2021-03-27T18:35:14.000Z | #!/usr/bin/env python
# Visual stock/share trading RL environment with continuous trade actions
# Chapter 5, TensorFlow 2 Reinforcement Learning Cookbook | Praveen Palanisamy
import os
import random
from typing import Dict
import cv2
import gym
import numpy as np
import pandas as pd
from gym import spaces
from tradi... | 35.141463 | 88 | 0.593282 |
import os
import random
from typing import Dict
import cv2
import gym
import numpy as np
import pandas as pd
from gym import spaces
from trading_utils import TradeVisualizer
env_config = {
"ticker": "MSFT",
"opening_account_balance": 1000,
"observation_horizon_sequence_length": 30,
}
class Sto... | true | true |
f725a200284daaaded9eadc2048d2708f4206809 | 109,449 | py | Python | olfactorybulb/slices/CoronalSlice/TC4_0.py | fameshpatel/olfactorybulb | 8d7a644b4560309ef177c0590ff73ed4c2432604 | [
"MIT"
] | null | null | null | olfactorybulb/slices/CoronalSlice/TC4_0.py | fameshpatel/olfactorybulb | 8d7a644b4560309ef177c0590ff73ed4c2432604 | [
"MIT"
] | null | null | null | olfactorybulb/slices/CoronalSlice/TC4_0.py | fameshpatel/olfactorybulb | 8d7a644b4560309ef177c0590ff73ed4c2432604 | [
"MIT"
] | null | null | null |
from neuron import h
class TransformTC4:
def __init__(self):
# Create a section lookup by section name
# Note: this assumes each section has a unique name
self.name2section = { sec.name(): sec for sec in h.allsec() }
# This will store the new section coordinates
self.sect... | 92.910866 | 3,305 | 0.576177 |
from neuron import h
class TransformTC4:
def __init__(self):
self.name2section = { sec.name(): sec for sec in h.allsec() }
self.section_coords = { }
def set_coords(self, sec_name):
nrn_section = self.name2section[sec_name]
new_co... | true | true |
f725a28db4c34f0091289d14f2db993acdf9d82d | 9,405 | py | Python | core/addons/api/__init__.py | photos-network/core | dae64af83dccfa37fc0923370072a360da941c28 | [
"Apache-2.0"
] | 4 | 2020-12-30T12:48:46.000Z | 2022-03-29T17:44:00.000Z | core/addons/api/__init__.py | photos-network/core | dae64af83dccfa37fc0923370072a360da941c28 | [
"Apache-2.0"
] | null | null | null | core/addons/api/__init__.py | photos-network/core | dae64af83dccfa37fc0923370072a360da941c28 | [
"Apache-2.0"
] | 2 | 2021-01-24T19:13:53.000Z | 2021-11-02T16:43:25.000Z | """REST API implementation."""
import json
import logging
import os
import pathlib
from datetime import datetime
from aiohttp import web
from core.addons.api.dto.details import Details
from core.addons.api.dto.location import Location
from core.addons.api.dto.photo import PhotoDetailsResponse, PhotoEncoder, PhotoResp... | 32.543253 | 101 | 0.612547 | import json
import logging
import os
import pathlib
from datetime import datetime
from aiohttp import web
from core.addons.api.dto.details import Details
from core.addons.api.dto.location import Location
from core.addons.api.dto.photo import PhotoDetailsResponse, PhotoEncoder, PhotoResponse
from core.addons.api.dto.p... | true | true |
f725a39885307cc168891a50213872ddbdd21689 | 1,475 | py | Python | _unittests/ut_module/test_code_style.py | sdpython/papierstat | f69de884c59ada30b58224dca39f2a44d92122c1 | [
"MIT"
] | 7 | 2019-03-21T09:52:31.000Z | 2021-01-17T16:56:27.000Z | _unittests/ut_module/test_code_style.py | sdpython/papierstat | f69de884c59ada30b58224dca39f2a44d92122c1 | [
"MIT"
] | 33 | 2018-02-08T23:56:57.000Z | 2021-02-10T23:55:43.000Z | _unittests/ut_module/test_code_style.py | sdpython/papierstat | f69de884c59ada30b58224dca39f2a44d92122c1 | [
"MIT"
] | 1 | 2021-02-11T09:16:33.000Z | 2021-02-11T09:16:33.000Z | """
@brief test log(time=150s)
"""
import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import check_pep8, ExtTestCase
class TestCodeStyle(ExtTestCase):
"""Test style."""
def test_style_src(self):
thi = os.path.abspath(os.path.dirname(__file__))
sr... | 38.815789 | 88 | 0.520678 | import os
import unittest
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import check_pep8, ExtTestCase
class TestCodeStyle(ExtTestCase):
def test_style_src(self):
thi = os.path.abspath(os.path.dirname(__file__))
src_ = os.path.normpath(os.path.join(thi, "..", "..", "src"))
... | true | true |
f725a3fd1b003a319b8f8190e60431bedbbcf49d | 1,698 | py | Python | src/LossFunctions/ActionCrossEntropy.py | Marcel-Rodekamp/MLP | 349ac8e10679e2ec53980908c580902996a493e7 | [
"MIT"
] | 1 | 2021-06-15T09:01:09.000Z | 2021-06-15T09:01:09.000Z | src/LossFunctions/ActionCrossEntropy.py | Marcel-Rodekamp/MLP | 349ac8e10679e2ec53980908c580902996a493e7 | [
"MIT"
] | null | null | null | src/LossFunctions/ActionCrossEntropy.py | Marcel-Rodekamp/MLP | 349ac8e10679e2ec53980908c580902996a493e7 | [
"MIT"
] | null | null | null | import torch
class ActionCrossEntropyFunction(torch.autograd.Function):
@staticmethod
def forward(self,input,target,action,force = None):
self.mb_size,self.dim = input.size()
# save the force for backward
self.force = force
# get action difference
action_input = torch... | 36.913043 | 148 | 0.689046 | import torch
class ActionCrossEntropyFunction(torch.autograd.Function):
@staticmethod
def forward(self,input,target,action,force = None):
self.mb_size,self.dim = input.size()
self.force = force
action_input = torch.tensor( [action(input[i_mb,:].numpy()) for i_mb in ... | true | true |
f725a5330ea476bf3d80b1dcb996e9b5875e2f37 | 918 | py | Python | setup.py | NgHoangDat/lescode | f19d8f2ca47aee947d2b2d88e5008ce4a58faeb6 | [
"MIT"
] | 1 | 2020-06-17T03:33:58.000Z | 2020-06-17T03:33:58.000Z | setup.py | NgHoangDat/lescode | f19d8f2ca47aee947d2b2d88e5008ce4a58faeb6 | [
"MIT"
] | null | null | null | setup.py | NgHoangDat/lescode | f19d8f2ca47aee947d2b2d88e5008ce4a58faeb6 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
__VERSION__ = "0.2.10"
setuptools.setup(
name="lescode",
packages=setuptools.find_packages(),
version=__VERSION__,
author="nghoangdat",
author_email="18.hoang.dat.12@gmail.com",
descripti... | 27 | 88 | 0.641612 | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
__VERSION__ = "0.2.10"
setuptools.setup(
name="lescode",
packages=setuptools.find_packages(),
version=__VERSION__,
author="nghoangdat",
author_email="18.hoang.dat.12@gmail.com",
descripti... | true | true |
f725a7c0a43b428ee68f9ed16d64cc59f6ac188b | 11,328 | py | Python | haystack/utils/squad_data.py | ArzelaAscoIi/haystack | be8f50c9e3de4e264b3f345f5f4b9c9ec518ed08 | [
"Apache-2.0"
] | 1 | 2022-02-15T04:32:41.000Z | 2022-02-15T04:32:41.000Z | haystack/utils/squad_data.py | ArzelaAscoIi/haystack | be8f50c9e3de4e264b3f345f5f4b9c9ec518ed08 | [
"Apache-2.0"
] | null | null | null | haystack/utils/squad_data.py | ArzelaAscoIi/haystack | be8f50c9e3de4e264b3f345f5f4b9c9ec518ed08 | [
"Apache-2.0"
] | null | null | null | from typing import List
import logging
import json
import random
import pandas as pd
from tqdm import tqdm
from haystack.schema import Document, Label
from haystack.modeling.data_handler.processor import _read_squad_file
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
tqdm... | 36.779221 | 124 | 0.566561 | from typing import List
import logging
import json
import random
import pandas as pd
from tqdm import tqdm
from haystack.schema import Document, Label
from haystack.modeling.data_handler.processor import _read_squad_file
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
tqdm... | true | true |
f725a83f718d805f89f9a0c04adb8de750d17bf3 | 7,720 | py | Python | tests/test_settings.py | zbyte64/django-dockit | 8d00a46cb0b6237de622fcb6816067078106a0c4 | [
"BSD-3-Clause"
] | 5 | 2015-02-25T17:01:48.000Z | 2021-06-03T07:46:47.000Z | tests/test_settings.py | zbyte64/django-dockit | 8d00a46cb0b6237de622fcb6816067078106a0c4 | [
"BSD-3-Clause"
] | 1 | 2015-03-11T15:19:55.000Z | 2015-04-13T04:14:24.000Z | tests/test_settings.py | zbyte64/django-dockit | 8d00a46cb0b6237de622fcb6816067078106a0c4 | [
"BSD-3-Clause"
] | null | null | null | # Django settings for {{ project_name }} project.
import os
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add ... | 34.618834 | 122 | 0.651684 |
import os
PROJECT_DIR = os.path.dirname(os.path.abspath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:',
'USER': '',
... | true | true |
f725a8967049f2e2f616b7777ed95915bf059305 | 82 | py | Python | src/yeelight_atmosphere/__init__.py | NikSavilov/yeelight-atmosphere | 8860c2869380be50a6305b5b2aa77ed3636145d3 | [
"MIT"
] | null | null | null | src/yeelight_atmosphere/__init__.py | NikSavilov/yeelight-atmosphere | 8860c2869380be50a6305b5b2aa77ed3636145d3 | [
"MIT"
] | 7 | 2021-11-13T13:07:21.000Z | 2021-11-19T16:30:37.000Z | src/yeelight_atmosphere/__init__.py | NikSavilov/yeelight-atmosphere | 8860c2869380be50a6305b5b2aa77ed3636145d3 | [
"MIT"
] | null | null | null | """
Package allows to interact with Yeelight bulbs.
"""
__author__ = "Savilov N."
| 16.4 | 47 | 0.707317 | __author__ = "Savilov N."
| true | true |
f725a9201795c774934495e6a45ebb15b68ea359 | 5,930 | py | Python | doc/conf.py | open-dynamic-robot-initiative/mw_dual_motor_torque_ctrl | 765b2ac852952d0643caec652b2b92e9d7d18dd9 | [
"BSD-3-Clause"
] | 10 | 2020-07-06T01:06:58.000Z | 2022-03-13T23:37:46.000Z | doc/conf.py | open-dynamic-robot-initiative/mw_dual_motor_torque_ctrl | 765b2ac852952d0643caec652b2b92e9d7d18dd9 | [
"BSD-3-Clause"
] | 4 | 2019-08-30T06:37:14.000Z | 2021-10-05T12:28:39.000Z | doc/conf.py | open-dynamic-robot-initiative/mw_dual_motor_torque_ctrl | 765b2ac852952d0643caec652b2b92e9d7d18dd9 | [
"BSD-3-Clause"
] | 5 | 2021-01-01T16:03:55.000Z | 2022-02-17T22:02:35.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# ODRI Motor Board Firmware for CAN Communication documentation build
# configuration file, created by sphinx-quickstart on Thu Aug 12 17:06:32 2021.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible confi... | 30.885417 | 79 | 0.679764 |
extensions = [
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.mathjax",
"sphinx.ext.githubpages",
]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = "ODRI Firmware for CAN"
copyright = "2021, Max Planck Gesellsch... | true | true |
f725a9c6f543a4459d5a893dca60433b20e32993 | 4,539 | py | Python | sort.py | sagittarian/personal-sort | c7875141b4e15173e4a4a2267a23ff8236e6d729 | [
"MIT"
] | null | null | null | sort.py | sagittarian/personal-sort | c7875141b4e15173e4a4a2267a23ff8236e6d729 | [
"MIT"
] | null | null | null | sort.py | sagittarian/personal-sort | c7875141b4e15173e4a4a2267a23ff8236e6d729 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''A simple implementation of a sorting algorithm, meant to allow
people to manually rank a list of items using whatever subjective or
objective criteria they want.
This program can be called as a script and used interactively. You
can provide the list of things to sort as command line argument... | 28.192547 | 72 | 0.548579 |
from functools import cmp_to_key
class memoize:
def __init__(self, func):
self.func = func
self.cache = {}
def __call__(self, *args):
key = tuple(args)
if key not in self.cache:
self.cache[key] = self.func(*args)
return self.cache[key]
@memoize
def cmpfu... | true | true |
f725a9f9f6417c88c9e26be77336dc65fc531a7b | 1,577 | py | Python | preprocessing/homography_converter/uNetXST_homographies/2_F.py | LimJiaJing/Cam2BEV | 8177e13f7a3662daee28cce62f35b85f500941c0 | [
"MIT"
] | 335 | 2020-05-11T07:24:01.000Z | 2022-03-31T08:14:22.000Z | preprocessing/homography_converter/uNetXST_homographies/2_F.py | hoanganhpham1006/Cam2BEV | f788a9f58b464bc7b114e5a0dd1afcd6683f10e3 | [
"MIT"
] | 23 | 2020-07-12T23:42:31.000Z | 2022-03-26T09:42:01.000Z | preprocessing/homography_converter/uNetXST_homographies/2_F.py | hoanganhpham1006/Cam2BEV | f788a9f58b464bc7b114e5a0dd1afcd6683f10e3 | [
"MIT"
] | 63 | 2020-05-11T16:27:56.000Z | 2022-03-17T17:11:18.000Z | # ==============================================================================
# MIT License
#
# Copyright 2020 Institute for Automotive Engineering of RWTH Aachen University.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "S... | 50.870968 | 213 | 0.698795 |
import numpy as np
H = [
np.array([[0.03506686613905922, 27.971438297785962, -0.17694724954191404], [0.3821882391578238, 9.481642330993019e-17, 5.46222110929461], [25.000001047737943, 6.202207287472715e-15, 27.000001047737943]])
]
| true | true |
f725ab2fdd412236541d778007d38e8624e6c5f3 | 1,105 | py | Python | gcloud/periodictask/apps.py | springborland/bk-sops | a9057672c10efb5f2414a805a30ead4092429c76 | [
"Apache-2.0"
] | 1 | 2021-05-19T04:31:34.000Z | 2021-05-19T04:31:34.000Z | gcloud/periodictask/apps.py | sighttviewliu/bk-sops | 6bf2f38bd93990f20f7c3a4decafc310e09e679c | [
"Apache-2.0"
] | null | null | null | gcloud/periodictask/apps.py | sighttviewliu/bk-sops | 6bf2f38bd93990f20f7c3a4decafc310e09e679c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 40.925926 | 115 | 0.755656 |
from django.apps import AppConfig
class PeriodicTaskConfig(AppConfig):
name = "gcloud.periodictask"
verbose_name = "GcloudPeriodicTask"
def ready(self):
from .signals.handlers import (
pre_periodic_task_start_handler,
periodic_task_history_post_save_handler,
... | true | true |
f725abd59251190289dabcf79ac0661b33697890 | 1,839 | py | Python | alembic/versions/4f53ec506661_add_study_template.py | jonathanzong/dmca | 70157cff983310e5951024aa80e99e7a5404d758 | [
"MIT"
] | 2 | 2022-02-16T22:50:06.000Z | 2022-02-21T19:38:02.000Z | alembic/versions/4f53ec506661_add_study_template.py | jonathanzong/dmca | 70157cff983310e5951024aa80e99e7a5404d758 | [
"MIT"
] | 2 | 2022-02-01T05:48:07.000Z | 2022-02-01T05:49:29.000Z | alembic/versions/4f53ec506661_add_study_template.py | jonathanzong/bartleby | 70157cff983310e5951024aa80e99e7a5404d758 | [
"MIT"
] | null | null | null | """add study template
Revision ID: 4f53ec506661
Revises: 4302608638bc
Create Date: 2018-05-23 15:44:01.450488
"""
# revision identifiers, used by Alembic.
revision = '4f53ec506661'
down_revision = '4302608638bc'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engi... | 28.292308 | 125 | 0.712887 |
revision = '4f53ec506661'
down_revision = '4302608638bc'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engine_name):
globals()["upgrade_%s" % engine_name]()
def downgrade(engine_name):
globals()["downgrade_%s" % engine_name]()
def upgrade_developme... | true | true |
f725acb2361d7d3cd6f93696255dbd053911f91e | 18,253 | py | Python | iotbx/regression/tst_map_model_manager_3.py | TiankunZhou/cctbx_project | 373f302f00c12d7239f8e37e3165e62bc1d852cc | [
"BSD-3-Clause-LBNL"
] | null | null | null | iotbx/regression/tst_map_model_manager_3.py | TiankunZhou/cctbx_project | 373f302f00c12d7239f8e37e3165e62bc1d852cc | [
"BSD-3-Clause-LBNL"
] | null | null | null | iotbx/regression/tst_map_model_manager_3.py | TiankunZhou/cctbx_project | 373f302f00c12d7239f8e37e3165e62bc1d852cc | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import absolute_import, division, print_function
from cctbx.array_family import flex
import os, sys
from libtbx.utils import Sorry
from libtbx.test_utils import approx_equal
from mmtbx.model import manager as model_manager
from iotbx.data_manager import DataManager
def exercise(file_name, out = sys.std... | 38.027083 | 92 | 0.718402 | from __future__ import absolute_import, division, print_function
from cctbx.array_family import flex
import os, sys
from libtbx.utils import Sorry
from libtbx.test_utils import approx_equal
from mmtbx.model import manager as model_manager
from iotbx.data_manager import DataManager
def exercise(file_name, out = sys.std... | true | true |
f725ad5a075727936af4a26120e61b5c25cd3bc9 | 193,257 | py | Python | backend/mips_to_c/src/translate.py | Rainchus/decomp.me | 607aab29a18656dcbc0443505ef2944c10afa085 | [
"MIT"
] | null | null | null | backend/mips_to_c/src/translate.py | Rainchus/decomp.me | 607aab29a18656dcbc0443505ef2944c10afa085 | [
"MIT"
] | null | null | null | backend/mips_to_c/src/translate.py | Rainchus/decomp.me | 607aab29a18656dcbc0443505ef2944c10afa085 | [
"MIT"
] | null | null | null | import abc
from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass, field, replace
import math
import struct
import sys
import traceback
import typing
from typing import (
AbstractSet,
Callable,
Collection,
DefaultDict,
Dict,
Iterator,
List... | 38.14032 | 131 | 0.598064 | import abc
from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass, field, replace
import math
import struct
import sys
import traceback
import typing
from typing import (
AbstractSet,
Callable,
Collection,
DefaultDict,
Dict,
Iterator,
List... | true | true |
f725ad7f8cee325b6f43a8b62288b6b7f43cee75 | 2,727 | py | Python | ibis/backends/clickhouse/tests/test_types.py | GrapeBaBa/ibis | 507bb14efdcfd719a0487ee23fe1c85c177517f6 | [
"Apache-2.0"
] | 1 | 2015-11-05T15:40:12.000Z | 2015-11-05T15:40:12.000Z | ibis/backends/clickhouse/tests/test_types.py | GrapeBaBa/ibis | 507bb14efdcfd719a0487ee23fe1c85c177517f6 | [
"Apache-2.0"
] | 7 | 2021-09-02T21:18:10.000Z | 2022-01-31T12:03:40.000Z | ibis/backends/clickhouse/tests/test_types.py | GrapeBaBa/ibis | 507bb14efdcfd719a0487ee23fe1c85c177517f6 | [
"Apache-2.0"
] | null | null | null | import pytest
from pkg_resources import parse_version
import ibis.expr.datatypes as dt
from ibis.backends.clickhouse.client import ClickhouseDataType
def test_column_types(alltypes):
df = alltypes.execute()
assert df.tinyint_col.dtype.name == 'int8'
assert df.smallint_col.dtype.name == 'int16'
assert... | 41.953846 | 76 | 0.635497 | import pytest
from pkg_resources import parse_version
import ibis.expr.datatypes as dt
from ibis.backends.clickhouse.client import ClickhouseDataType
def test_column_types(alltypes):
df = alltypes.execute()
assert df.tinyint_col.dtype.name == 'int8'
assert df.smallint_col.dtype.name == 'int16'
assert... | true | true |
f725adf48debebf7012aabc4bd719b3c1bf15fb2 | 13,130 | py | Python | torchreid/data_manager/cuhk03.py | phoenix1712/deep-person-reid | 8537a9d94b31cbf85e475bd115bb2714086f9be0 | [
"MIT"
] | 11 | 2019-01-10T08:03:31.000Z | 2020-10-23T03:14:23.000Z | torchreid/data_manager/cuhk03.py | xinshengwang/deep-person-reid | 70365320f5319e180d7fce4993003382b06906b0 | [
"MIT"
] | 1 | 2020-11-13T08:20:53.000Z | 2021-01-12T23:06:55.000Z | torchreid/data_manager/cuhk03.py | xinshengwang/deep-person-reid | 70365320f5319e180d7fce4993003382b06906b0 | [
"MIT"
] | 8 | 2019-03-05T09:12:54.000Z | 2022-02-05T06:21:21.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import re
import sys
import urllib
import tarfile
import zipfile
import os.path as osp
from scipy.io import loadmat
import numpy as np
import h5py
from scipy.misc import imsave
from torch... | 46.560284 | 127 | 0.6131 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import glob
import re
import sys
import urllib
import tarfile
import zipfile
import os.path as osp
from scipy.io import loadmat
import numpy as np
import h5py
from scipy.misc import imsave
from torch... | true | true |
f725ae061cedbfc0818ee7c7320e4bbe82b540ad | 62,902 | py | Python | pandas/core/groupby/generic.py | selasley/pandas | 5b5574520dba1e79ac95e5079724a41151c20b9a | [
"BSD-3-Clause"
] | null | null | null | pandas/core/groupby/generic.py | selasley/pandas | 5b5574520dba1e79ac95e5079724a41151c20b9a | [
"BSD-3-Clause"
] | null | null | null | pandas/core/groupby/generic.py | selasley/pandas | 5b5574520dba1e79ac95e5079724a41151c20b9a | [
"BSD-3-Clause"
] | null | null | null | """
Define the SeriesGroupBy and DataFrameGroupBy
classes that hold the groupby interfaces (and some implementations).
These are user facing as the result of the ``df.groupby(...)`` operations,
which here returns a DataFrameGroupBy object.
"""
from __future__ import annotations
from collections import abc
from functo... | 34.204459 | 88 | 0.555833 | from __future__ import annotations
from collections import abc
from functools import partial
from textwrap import dedent
from typing import (
Any,
Callable,
Hashable,
Iterable,
Mapping,
NamedTuple,
Sequence,
TypeVar,
Union,
cast,
)
import warnings
import numpy as np
from panda... | true | true |
f725aeade897e373631ced4d97f1f6a440b377d9 | 1,600 | py | Python | utils/runner/optimizer/builder.py | UESTC-Liuxin/CVMI_Sementic_Segmentation | dc5bf6e940cf6961ef65abb6e7ec372f29d55249 | [
"Apache-2.0"
] | null | null | null | utils/runner/optimizer/builder.py | UESTC-Liuxin/CVMI_Sementic_Segmentation | dc5bf6e940cf6961ef65abb6e7ec372f29d55249 | [
"Apache-2.0"
] | null | null | null | utils/runner/optimizer/builder.py | UESTC-Liuxin/CVMI_Sementic_Segmentation | dc5bf6e940cf6961ef65abb6e7ec372f29d55249 | [
"Apache-2.0"
] | null | null | null | '''
Author: Liu Xin
Date: 2021-11-21 18:10:58
LastEditors: Liu Xin
LastEditTime: 2021-11-21 21:38:30
Description: file content
FilePath: /CVMI_Sementic_Segmentation/utils/runner/optimizer/builder.py
'''
import copy
import inspect
import torch
from utils.registry import Registry, build
OPTIMIZERS = Registry('optimizer'... | 30.188679 | 73 | 0.683125 | import copy
import inspect
import torch
from utils.registry import Registry, build
OPTIMIZERS = Registry('optimizer')
OPTIMIZER_BUILDERS = Registry('optimizer builder')
def register_torch_optimizers():
torch_optimizers = []
for module_name in dir(torch.optim):
if module_name.startswith('__'):
... | true | true |
f725afde370dd3d08133a4a847cf11682d4bc65e | 30 | py | Python | py_yahoo/__init__.py | satheshrgs/py_yahoo | c18d680a9c75bb28364b95ada8b4dead0302d6ed | [
"MIT"
] | null | null | null | py_yahoo/__init__.py | satheshrgs/py_yahoo | c18d680a9c75bb28364b95ada8b4dead0302d6ed | [
"MIT"
] | null | null | null | py_yahoo/__init__.py | satheshrgs/py_yahoo | c18d680a9c75bb28364b95ada8b4dead0302d6ed | [
"MIT"
] | null | null | null | from .py_yahoo import YWeather | 30 | 30 | 0.866667 | from .py_yahoo import YWeather | true | true |
f725b02ef1848fb30f10583d1d0ba4ed093eebfa | 878 | py | Python | examples/demo1/main.py | Layto888/laylib-1.0.1 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | 1 | 2018-08-04T14:44:42.000Z | 2018-08-04T14:44:42.000Z | examples/demo1/main.py | Layto888/laylib-1.0 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | null | null | null | examples/demo1/main.py | Layto888/laylib-1.0 | c7317c29659a476adf6e90eb729b09ce4c49e219 | [
"MIT"
] | null | null | null | """
Demo 01 Made with python and pygame
to test and improve the laylib-pygame framework for fast game prototyping.
----
Author: Amardjia Amine
Date: 20/10/18
Github: ---
- This demo shows how the Resources manager loads and
separates the different data and their associated variables.
All resources are ... | 22.512821 | 75 | 0.632118 |
from laylib import Environment
from engine import Engine
import sys
def main():
demo = Environment(
800,
600,
False,
'2D Demo'
)
demo.load_complete(Engine(), '../data')
demo.gInstance.main_loop()
demo.destroy()
... | true | true |
f725b0a65f050af516439f7b25d526190cc56ff4 | 15,585 | py | Python | mpunet/callbacks/callbacks.py | sandeepsinghsengar/MPUNet2Plus | fd97800cd349ee47d2c9cce1851a332dcbcb047c | [
"MIT"
] | 156 | 2018-12-19T19:21:30.000Z | 2022-03-10T13:14:52.000Z | mpunet/callbacks/callbacks.py | sandeepsinghsengar/MPUNet2Plus | fd97800cd349ee47d2c9cce1851a332dcbcb047c | [
"MIT"
] | 25 | 2019-07-30T07:45:26.000Z | 2022-02-10T00:38:31.000Z | mpunet/callbacks/callbacks.py | sandeepsinghsengar/MPUNet2Plus | fd97800cd349ee47d2c9cce1851a332dcbcb047c | [
"MIT"
] | 33 | 2019-01-26T16:34:50.000Z | 2022-02-20T13:48:44.000Z | import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import tensorflow as tf
import psutil
import numpy as np
import os
from tensorflow.keras.callbacks import Callback
from datetime import datetime
from mpunet.logging import ScreenLogger
from mpunet.utils.plotting import (imshow_with_label_overlay, i... | 37.019002 | 86 | 0.569714 | import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import tensorflow as tf
import psutil
import numpy as np
import os
from tensorflow.keras.callbacks import Callback
from datetime import datetime
from mpunet.logging import ScreenLogger
from mpunet.utils.plotting import (imshow_with_label_overlay, i... | true | true |
f725b10ac41ecee5ca5b5e982437b8bbd0484e3c | 273 | py | Python | src/password_generator.py | thiamsantos/python-labs | 91262d64b3772526d91db96976f2df77011a2343 | [
"MIT"
] | null | null | null | src/password_generator.py | thiamsantos/python-labs | 91262d64b3772526d91db96976f2df77011a2343 | [
"MIT"
] | null | null | null | src/password_generator.py | thiamsantos/python-labs | 91262d64b3772526d91db96976f2df77011a2343 | [
"MIT"
] | null | null | null | import string
import random
def generate_password():
chars = string.ascii_letters + string.digits + string.punctuation
return ''.join([random.choice(chars) for i in range(0, 15)])
def main():
print(generate_password())
if __name__ == '__main__':
main()
| 19.5 | 69 | 0.692308 | import string
import random
def generate_password():
chars = string.ascii_letters + string.digits + string.punctuation
return ''.join([random.choice(chars) for i in range(0, 15)])
def main():
print(generate_password())
if __name__ == '__main__':
main()
| true | true |
f725b1ae42f7b8692600bca55736971aa629fa7d | 4,921 | py | Python | lib/jnpr/healthbot/swagger/models/rule_schema_formula_min.py | Juniper/healthbot-py-client | 49f0884b5d01ac8430aa7ed4c9acb4e7a2b717a6 | [
"Apache-2.0"
] | 10 | 2019-10-23T12:54:37.000Z | 2022-02-07T19:24:30.000Z | lib/jnpr/healthbot/swagger/models/rule_schema_formula_min.py | Juniper/healthbot-py-client | 49f0884b5d01ac8430aa7ed4c9acb4e7a2b717a6 | [
"Apache-2.0"
] | 5 | 2019-09-30T04:29:25.000Z | 2022-02-16T12:21:06.000Z | lib/jnpr/healthbot/swagger/models/rule_schema_formula_min.py | Juniper/healthbot-py-client | 49f0884b5d01ac8430aa7ed4c9acb4e7a2b717a6 | [
"Apache-2.0"
] | 4 | 2019-09-30T01:17:48.000Z | 2020-08-25T07:27:54.000Z | # coding: utf-8
"""
Paragon Insights APIs
API interface for PI application # noqa: E501
OpenAPI spec version: 4.0.0
Contact: healthbot-feedback@juniper.net
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RuleSchemaF... | 32.806667 | 186 | 0.59622 |
import pprint
import re
import six
class RuleSchemaFormulaMin(object):
swagger_types = {
'field_name': 'str',
'time_range': 'str'
}
attribute_map = {
'field_name': 'field-name',
'time_range': 'time-range'
}
def __init__(self, field_name=None, time_range=No... | true | true |
f725b253adc761c90bb78171d6e459fcd4106d11 | 5,638 | py | Python | tests/integration/climsoft/controller/test_regkey_controller.py | opencdms/opencdms-api | f1ed6e1d883025a8658746fe457e0c975718c7be | [
"MIT"
] | 3 | 2020-12-01T09:25:18.000Z | 2022-02-14T23:57:34.000Z | tests/integration/climsoft/controller/test_regkey_controller.py | opencdms/opencdms-api | f1ed6e1d883025a8658746fe457e0c975718c7be | [
"MIT"
] | 11 | 2021-12-05T10:09:00.000Z | 2022-02-17T08:11:22.000Z | tests/integration/climsoft/controller/test_regkey_controller.py | opencdms/opencdms-api | f1ed6e1d883025a8658746fe457e0c975718c7be | [
"MIT"
] | 2 | 2021-03-10T19:03:05.000Z | 2021-12-11T08:36:04.000Z | import json
import pytest
from sqlalchemy.sql import text as sa_text
from sqlalchemy.orm.session import sessionmaker
from opencdms.models.climsoft import v4_1_1_core as climsoft_models
from apps.climsoft.db.engine import db_engine
from apps.climsoft.schemas import regkey_schema
from datagen.climsoft import regkey as cl... | 37.586667 | 118 | 0.707166 | import json
import pytest
from sqlalchemy.sql import text as sa_text
from sqlalchemy.orm.session import sessionmaker
from opencdms.models.climsoft import v4_1_1_core as climsoft_models
from apps.climsoft.db.engine import db_engine
from apps.climsoft.schemas import regkey_schema
from datagen.climsoft import regkey as cl... | true | true |
f725b3453489b66fbfc7b49799e450b8abfbfc00 | 11,264 | py | Python | deployer/src/config_creator.py | yugabyte/docsearch-scraper | 8b58d364c7721cbce892843e946834a3ccc5fcd7 | [
"MIT"
] | null | null | null | deployer/src/config_creator.py | yugabyte/docsearch-scraper | 8b58d364c7721cbce892843e946834a3ccc5fcd7 | [
"MIT"
] | null | null | null | deployer/src/config_creator.py | yugabyte/docsearch-scraper | 8b58d364c7721cbce892843e946834a3ccc5fcd7 | [
"MIT"
] | 1 | 2020-04-01T22:01:17.000Z | 2020-04-01T22:01:17.000Z | from collections import OrderedDict
import tldextract
import re
from . import helpers
from . import helpdesk_helper
from urllib.parse import urlparse
def extract_root_from_input(input_string):
# We cant parse the url since user might have not enter a proper link
# We assume that the string is already the pro... | 34.552147 | 110 | 0.532404 | from collections import OrderedDict
import tldextract
import re
from . import helpers
from . import helpdesk_helper
from urllib.parse import urlparse
def extract_root_from_input(input_string):
if input_string.endswith('/'):
return input_string
domain = re.match(".+?([^/]/(?!/))",
... | true | true |
f725b3e77a5288c1d9314ff987b54ca1c859daff | 46,076 | py | Python | tests/plugins/test_reactor_config.py | MartinBasti/atomic-reactor | 4431225c5a474c7f88c63ec1f25216d4b84a0f1d | [
"BSD-3-Clause"
] | null | null | null | tests/plugins/test_reactor_config.py | MartinBasti/atomic-reactor | 4431225c5a474c7f88c63ec1f25216d4b84a0f1d | [
"BSD-3-Clause"
] | null | null | null | tests/plugins/test_reactor_config.py | MartinBasti/atomic-reactor | 4431225c5a474c7f88c63ec1f25216d4b84a0f1d | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2017 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from jsonschema import ValidationError
import io
import logging
import os
import pkg_resources
import... | 35.092155 | 100 | 0.532924 | from __future__ import unicode_literals
from jsonschema import ValidationError
import io
import logging
import os
import pkg_resources
import pytest
from textwrap import dedent
import re
import yaml
import smtplib
from copy import deepcopy
import atomic_reactor
import koji
from atomic_reactor.core import DockerTasker... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.