hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
08f9a9b3d4eaab63e24a0d31b831e3b0be5a314d | 861 | py | Python | timm/utils/metrics.py | DifferentSC/pytorch-image-models | ccfb5751abc70d80add4f197464190c4a2637c6c | [
"Apache-2.0"
] | 24 | 2020-10-28T14:53:47.000Z | 2022-02-02T19:20:28.000Z | timm/utils/metrics.py | meteozay/pytorch-image-models | 80078c47bb5b60d337f294594433bbd6809f3975 | [
"Apache-2.0"
] | null | null | null | timm/utils/metrics.py | meteozay/pytorch-image-models | 80078c47bb5b60d337f294594433bbd6809f3975 | [
"Apache-2.0"
] | 2 | 2020-12-10T07:14:49.000Z | 2021-05-25T18:56:38.000Z | """ Eval metrics and related
Hacked together by / Copyright 2020 Ross Wightman
"""
class AverageMeter:
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
... | 26.090909 | 88 | 0.59698 |
class AverageMeter:
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, n=1):
self.val = val
self.sum += val * n
self.count += n
self.avg = self.sum / self.co... | true | true |
08f9aa1b03061d55dae5665b8e2ceb1b76114d63 | 4,505 | py | Python | horizon/horizon/dashboards/syspanel/users/forms.py | andrewsmedina/horizon | 6892653c0573a6a55f359cce6c1796053ef65cbf | [
"Apache-2.0"
] | 1 | 2015-11-08T15:34:20.000Z | 2015-11-08T15:34:20.000Z | horizon/horizon/dashboards/syspanel/users/forms.py | andrewsmedina/horizon | 6892653c0573a6a55f359cce6c1796053ef65cbf | [
"Apache-2.0"
] | null | null | null | horizon/horizon/dashboards/syspanel/users/forms.py | andrewsmedina/horizon | 6892653c0573a6a55f359cce6c1796053ef65cbf | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... | 40.223214 | 78 | 0.586238 |
import logging
from django import shortcuts
from django.contrib import messages
from django.utils.translation import ugettext as _
from horizon import api
from horizon import exceptions
from horizon import forms
LOG = logging.getLogger(__name__)
class BaseUserForm(forms.SelfHandlingForm):
def __init__(self,... | true | true |
08f9aacd4a2988601abf46fb7e9fa6c8f1508597 | 4,373 | py | Python | py3/SciServer/Config.py | amitschang/SciScript-Python | c8aa133c032e794bb49ae1d97730e0fab754d793 | [
"Apache-2.0"
] | null | null | null | py3/SciServer/Config.py | amitschang/SciScript-Python | c8aa133c032e794bb49ae1d97730e0fab754d793 | [
"Apache-2.0"
] | null | null | null | py3/SciServer/Config.py | amitschang/SciScript-Python | c8aa133c032e794bb49ae1d97730e0fab754d793 | [
"Apache-2.0"
] | null | null | null | import json
import os
"""
The SciServer.Config module contains important parameters for the correct functioning of the SciServer package.\n
Although these parameters must be set/defined by the admin or user before the installation of the package, they can also be accessed and changed on-the-fly while on the python sess... | 62.471429 | 255 | 0.744569 | import json
import os
CasJobsRESTUri = "https://skyserver.sdss.org/CasJobs/RestApi"
AuthenticationURL = "https://apps.sciserver.org/login-portal/keystone/v3/tokens"
SciDriveHost = "https://www.scidrive.org"
SkyQueryUrl = "http://voservices.net/skyquery/Api/V1"
SkyServerWSurl = "https://skyserver.sdss.org"
RacmApiURL = ... | true | true |
08f9aaea33717add111f4df58a62ce50744cd337 | 1,706 | py | Python | Topsis_lovish_101703312/topsis.py | lovishjindal2503/TOPSIS_project1 | 4ce4e15e04ac84b716a6ae6f4a50ac01fdb854d8 | [
"MIT"
] | null | null | null | Topsis_lovish_101703312/topsis.py | lovishjindal2503/TOPSIS_project1 | 4ce4e15e04ac84b716a6ae6f4a50ac01fdb854d8 | [
"MIT"
] | null | null | null | Topsis_lovish_101703312/topsis.py | lovishjindal2503/TOPSIS_project1 | 4ce4e15e04ac84b716a6ae6f4a50ac01fdb854d8 | [
"MIT"
] | null | null | null | import numpy as np
def Topsis(weights, numerical_data, impact):
try:
if(numerical_data.shape[1] != weights.shape[0] or weights.shape != impact.shape or numerical_data.shape[1] != impact.shape[0]):
raise Exception("Given input is not correct")
except Exception as e:
print("Given input is incorrect")
return
... | 39.674419 | 129 | 0.750879 | import numpy as np
def Topsis(weights, numerical_data, impact):
try:
if(numerical_data.shape[1] != weights.shape[0] or weights.shape != impact.shape or numerical_data.shape[1] != impact.shape[0]):
raise Exception("Given input is not correct")
except Exception as e:
print("Given input is incorrect")
return
... | true | true |
08f9ab1b644817989460462065ef6774e3d16ead | 3,962 | py | Python | scripts/createKmerErrorDistributionPlots.py | phspo/snakemake-ngs-spa-typing | de710308c1ad26303539d2998573d682caba3e25 | [
"MIT"
] | null | null | null | scripts/createKmerErrorDistributionPlots.py | phspo/snakemake-ngs-spa-typing | de710308c1ad26303539d2998573d682caba3e25 | [
"MIT"
] | null | null | null | scripts/createKmerErrorDistributionPlots.py | phspo/snakemake-ngs-spa-typing | de710308c1ad26303539d2998573d682caba3e25 | [
"MIT"
] | null | null | null | import json
import math
from scipy.stats import poisson
import sys
import logging
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from matplotlib.ticker import MaxNLocator
logging.basicConfig(filename=snakemake.log[0], level=logging.DEBUG,format="%(asctime)s:%(levelname)s:%(message)s")
#Read... | 37.028037 | 127 | 0.762998 | import json
import math
from scipy.stats import poisson
import sys
import logging
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
from matplotlib.ticker import MaxNLocator
logging.basicConfig(filename=snakemake.log[0], level=logging.DEBUG,format="%(asctime)s:%(levelname)s:%(message)s")
expec... | true | true |
08f9adbeb301f4e17b41cf1ed040cb5c59a2f01a | 845 | py | Python | cProjects.py | musdasch/cProjects | efc3c47f39b71e86633705fbd80117417298dcc0 | [
"WTFPL"
] | null | null | null | cProjects.py | musdasch/cProjects | efc3c47f39b71e86633705fbd80117417298dcc0 | [
"WTFPL"
] | null | null | null | cProjects.py | musdasch/cProjects | efc3c47f39b71e86633705fbd80117417298dcc0 | [
"WTFPL"
] | null | null | null | import sublime, sublime_plugin
import sys
from os.path import dirname, realpath, expanduser
scripts_path = dirname(realpath(__file__)) + "/scripts"
isset = False
for path in sys.path:
if path == scripts_path:
isset = True
if not isset:
sys.path.append(scripts_path)
# Import all Scripts
from buildCProject import ... | 27.258065 | 55 | 0.821302 | import sublime, sublime_plugin
import sys
from os.path import dirname, realpath, expanduser
scripts_path = dirname(realpath(__file__)) + "/scripts"
isset = False
for path in sys.path:
if path == scripts_path:
isset = True
if not isset:
sys.path.append(scripts_path)
from buildCProject import *
from newCProject im... | true | true |
08f9af14af1395df8f8c304d0e7de82b2009de12 | 10,781 | py | Python | examples/plot_raster_stack_crop.py | thayes805/earthpy | d34dfe9eb9e8b6ca0ded2541d3ddbac9cb15474b | [
"BSD-3-Clause"
] | null | null | null | examples/plot_raster_stack_crop.py | thayes805/earthpy | d34dfe9eb9e8b6ca0ded2541d3ddbac9cb15474b | [
"BSD-3-Clause"
] | null | null | null | examples/plot_raster_stack_crop.py | thayes805/earthpy | d34dfe9eb9e8b6ca0ded2541d3ddbac9cb15474b | [
"BSD-3-Clause"
] | 2 | 2021-01-02T02:32:41.000Z | 2021-01-02T02:32:41.000Z | """
Stack and Crop Raster Data Using EarthPy
========================================
Learn how to stack and crop satellite imagery using EarthPy
"""
###############################################################################
# Stack and Crop Raster Data Using EarthPy
# -------------------------------------------... | 36.921233 | 114 | 0.613394 |
import os
from glob import glob
import matplotlib.pyplot as plt
import rasterio as rio
from rasterio.plot import plotting_extent
import geopandas as gpd
import earthpy as et
import earthpy.spatial as es
import earthpy.plot as ep
data_path = et.data.get_data("vignette-landsat")
os.chdir(os.path.join(et.io.HOME,... | true | true |
08f9af58dd1991fb611e84d89d65e9625424c5d3 | 1,424 | py | Python | Hangman/hangman_part7.py | seakun/Python-Projects | 3c0e6bb1aa32a492b451f8d5bb0056a8abf82936 | [
"MIT"
] | 6 | 2021-08-31T07:57:24.000Z | 2022-02-08T15:16:23.000Z | Hangman/hangman_part7.py | seakun/Python-Projects | 3c0e6bb1aa32a492b451f8d5bb0056a8abf82936 | [
"MIT"
] | 1 | 2020-05-12T15:09:03.000Z | 2020-05-12T15:09:03.000Z | Hangman/hangman_part7.py | seakun/Python-Projects | 3c0e6bb1aa32a492b451f8d5bb0056a8abf82936 | [
"MIT"
] | 9 | 2021-08-31T07:57:24.000Z | 2022-03-05T19:10:29.000Z | import random
words_list = ['python', 'java', 'kotlin', 'javascript']
word = random.choice(words_list)
def hide_word(word_to_hide, list_of_letters):
for letter in word_to_hide:
if letter not in list_of_letters:
word_to_hide = word_to_hide.replace(letter, "-")
return word_to_hide
print("H ... | 26.867925 | 60 | 0.610955 | import random
words_list = ['python', 'java', 'kotlin', 'javascript']
word = random.choice(words_list)
def hide_word(word_to_hide, list_of_letters):
for letter in word_to_hide:
if letter not in list_of_letters:
word_to_hide = word_to_hide.replace(letter, "-")
return word_to_hide
print("H ... | true | true |
08f9af87de773d114a424187d76ed2f69b7073b4 | 4,841 | py | Python | fairr_reasoner_model.py | INK-USC/FaiRR | 7afe4c5277f0b415b82fde59b74db12600c6cc66 | [
"MIT"
] | 3 | 2022-03-27T13:09:09.000Z | 2022-03-29T10:00:03.000Z | fairr_reasoner_model.py | INK-USC/FaiRR | 7afe4c5277f0b415b82fde59b74db12600c6cc66 | [
"MIT"
] | null | null | null | fairr_reasoner_model.py | INK-USC/FaiRR | 7afe4c5277f0b415b82fde59b74db12600c6cc66 | [
"MIT"
] | null | null | null | '''
This script is the knowledge composer component of FaiRR. It takes the selected rule and facts and generates a new conclusion.
'''
from helper import *
from basemodel import BaseModel
class FaiRRReasoner(BaseModel):
def __init__(self, arch='t5_base', train_batch_size=16, eval_batch_size=16, accumulate_grad_batc... | 37.820313 | 162 | 0.695517 |
from helper import *
from basemodel import BaseModel
class FaiRRReasoner(BaseModel):
def __init__(self, arch='t5_base', train_batch_size=16, eval_batch_size=16, accumulate_grad_batches=1, learning_rate=1e-5, max_epochs=5,\
optimizer='adamw', adam_epsilon=1e-8, weight_decay=0.0, lr_scheduler='linear_with_warmup... | true | true |
08f9b1251d92720eb2c49b6fec79f0cba3c5c9cd | 901 | py | Python | scripts/plot_compare.py | CSchoel/hh-modelica | e84713a4a15bfcc5736755940e6af38bb6272521 | [
"MIT"
] | null | null | null | scripts/plot_compare.py | CSchoel/hh-modelica | e84713a4a15bfcc5736755940e6af38bb6272521 | [
"MIT"
] | 1 | 2021-06-21T15:04:57.000Z | 2021-06-25T08:54:00.000Z | scripts/plot_compare.py | CSchoel/hh-modelica | e84713a4a15bfcc5736755940e6af38bb6272521 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
import os
def compare(afile, bfile):
adata, bdata = [pd.read_csv(x, delimiter=",") for x in [afile, bfile]]
f = plt.figure(figsize=(6, 2), dpi=300)
ax = f.add_subplot()
ax.plot(adata["time"] * 1000, adata["v_m"], label="modular")
ax.plot(bdata["t... | 31.068966 | 74 | 0.651498 | import pandas as pd
import matplotlib.pyplot as plt
import os
def compare(afile, bfile):
adata, bdata = [pd.read_csv(x, delimiter=",") for x in [afile, bfile]]
f = plt.figure(figsize=(6, 2), dpi=300)
ax = f.add_subplot()
ax.plot(adata["time"] * 1000, adata["v_m"], label="modular")
ax.plot(bdata["t... | true | true |
08f9b167d6708bc5cb266dbf0c42d2e8ec814d1b | 1,826 | py | Python | collect_ElapsedTime.py | isabella232/pearu-sandbox | ece92fc2a6de19a21a9918196b1c34338a04e148 | [
"BSD-3-Clause"
] | 5 | 2018-10-17T20:28:42.000Z | 2022-02-15T17:33:01.000Z | collect_ElapsedTime.py | Quansight/pearu-sandbox | 3a4009af61197fcfd54dc854f2a00238bda10c2b | [
"BSD-3-Clause"
] | 19 | 2018-07-18T07:15:44.000Z | 2021-02-22T17:00:18.000Z | collect_ElapsedTime.py | isabella232/pearu-sandbox | ece92fc2a6de19a21a9918196b1c34338a04e148 | [
"BSD-3-Clause"
] | 2 | 2020-05-01T09:54:34.000Z | 2021-04-17T10:57:07.000Z | #!/usr/bin/env python
#
# Author: Pearu Peteson
# Created: May 2020
"""
class ElapsedTime {
/*
Report time elapsed in executing a block of code. Usage::
{
ElapsedTime _("code");
<block code>
}
Requires: #include <chrono>
*/
public:
ElapsedTime(std::string label)... | 29.451613 | 126 | 0.605696 |
import re
import sys
from collections import defaultdict
match = re.compile(r'ElapsedTime:\s*(?P<label>.*?)\s*took\s*(?P<count>\d+)\s*(?P<unit>\w+)').match
cummulative_results = defaultdict(int)
unit = None
total = 0
for line in sys.stdin.readlines():
m = match(line)
if m is not None:
cummulative_r... | true | true |
08f9b19aceaf9abf5ec5bb4f797144de52fd517f | 5,618 | py | Python | lib/alchemy/match.py | nachogentile/PatentsProcessor | 43ae7a727d3368811c828eeca6d6e484af8cb2f6 | [
"BSD-2-Clause"
] | 53 | 2015-01-19T17:46:40.000Z | 2022-03-28T21:15:42.000Z | lib/alchemy/match.py | kwanghui/patents | fa124bbfbc5950885757a738367dc4d1c6e7fa89 | [
"BSD-2-Clause"
] | 4 | 2015-05-11T14:59:13.000Z | 2019-03-05T19:12:46.000Z | lib/alchemy/match.py | kwanghui/patents | fa124bbfbc5950885757a738367dc4d1c6e7fa89 | [
"BSD-2-Clause"
] | 40 | 2015-02-10T04:28:49.000Z | 2022-01-04T21:53:27.000Z | """
Copyright (c) 2013 The Regents of the University of California, AMERICAN INSTITUTES FOR RESEARCH
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the abo... | 52.504673 | 123 | 0.746707 | """
Copyright (c) 2013 The Regents of the University of California, AMERICAN INSTITUTES FOR RESEARCH
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the abo... | false | true |
08f9b1ed86cfe3ce22f17296d68a3de184c4bf76 | 9,184 | py | Python | cisco_sdwan/base/catalog.py | ccie29824/CiscoDevNet-sastre | f5692dfa40903738c8ae7503932836bc3d928944 | [
"MIT"
] | 15 | 2020-09-25T13:16:51.000Z | 2022-02-08T08:19:30.000Z | cisco_sdwan/base/catalog.py | ccie29824/CiscoDevNet-sastre | f5692dfa40903738c8ae7503932836bc3d928944 | [
"MIT"
] | 1 | 2021-10-21T03:12:37.000Z | 2021-10-21T03:12:37.000Z | cisco_sdwan/base/catalog.py | ccie29824/CiscoDevNet-sastre | f5692dfa40903738c8ae7503932836bc3d928944 | [
"MIT"
] | 6 | 2020-10-15T19:16:11.000Z | 2021-09-30T01:55:25.000Z | """
Sastre - Automation Tools for Cisco SD-WAN Powered by Viptela
cisco_sdwan.base.catalog
This module implements vManage API Catalogs
"""
from typing import NamedTuple, Union, Optional, Iterator
from enum import Enum
from .models_base import IndexConfigItem, ConfigItem, RealtimeItem, BulkStateItem, BulkStatsItem
f... | 36.300395 | 120 | 0.692726 | from typing import NamedTuple, Union, Optional, Iterator
from enum import Enum
from .models_base import IndexConfigItem, ConfigItem, RealtimeItem, BulkStateItem, BulkStatsItem
from .rest_api import is_version_newer
CATALOG_TAG_ALL = 'all'
class CatalogItem(NamedTuple):
tag: str
info: str
index_cls: type... | true | true |
08f9b2c295052aea456a41c2f4d093f94b1cd64c | 1,395 | py | Python | P4J/__init__.py | phuijse/P4J | 0e7730d62f2d1d347f66bc6f8d0b8bbfe6d2f3c4 | [
"MIT"
] | 41 | 2016-07-14T23:28:37.000Z | 2022-03-31T06:43:56.000Z | P4J/__init__.py | phuijse/P4J | 0e7730d62f2d1d347f66bc6f8d0b8bbfe6d2f3c4 | [
"MIT"
] | 4 | 2017-07-22T12:26:06.000Z | 2021-01-04T19:12:04.000Z | P4J/__init__.py | phuijse/P4J | 0e7730d62f2d1d347f66bc6f8d0b8bbfe6d2f3c4 | [
"MIT"
] | 9 | 2017-05-21T17:35:17.000Z | 2021-08-25T11:33:59.000Z | """
P4J is a python package for period detection on irregularly sampled and heteroscedastic
time series based on Information Theoretic objective functions. P4J was
developed for astronomical light curves, irregularly sampled time series
of stellar magnitude or flux. The core of this package is a class called periodogr... | 42.272727 | 102 | 0.816487 |
__version__ = '1.0.0'
from .generator import synthetic_light_curve_generator
from .periodograms import periodogram, MultiBandPeriodogram
| true | true |
08f9b37c771a8d952210640e62e20673d881284b | 1,548 | py | Python | src/python/myriad/util/stringutil.py | TU-Berlin-DIMA/myriad-toolkit | 5f7610e10b11e05591d6e2dc030c3ca5dc2a90b4 | [
"BSL-1.0"
] | 15 | 2015-01-18T18:02:16.000Z | 2021-08-02T09:20:35.000Z | src/python/myriad/util/stringutil.py | TU-Berlin-DIMA/myriad-toolkit | 5f7610e10b11e05591d6e2dc030c3ca5dc2a90b4 | [
"BSL-1.0"
] | null | null | null | src/python/myriad/util/stringutil.py | TU-Berlin-DIMA/myriad-toolkit | 5f7610e10b11e05591d6e2dc030c3ca5dc2a90b4 | [
"BSL-1.0"
] | 5 | 2015-08-10T21:50:39.000Z | 2018-03-14T15:31:28.000Z | '''
This file is licensed unter the PSF License. For more information about the
license, please refer to
http://docs.python.org/license.html
@author: alane@sourceforge.net.
The original algorithm for this component was provided by Xavier Defrang.
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/81330.
'... | 27.157895 | 90 | 0.629199 |
import re
import UserDict
class TextSub(UserDict.UserDict):
def __init__(self, dict = None):
self.re = None
self.regex = None
UserDict.UserDict.__init__(self, dict)
def compile(self):
if len(self.data) > 0:
tmp = "(%s)" % "|".join(map(re.escape, map(self.f... | true | true |
08f9b402cf8e548a94888c84d697ca6d387e7cd0 | 13,172 | py | Python | tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py | Yannic/chromium | ab32e8aacb08c9fce0dc4bf09eec456ba46e3710 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py | Yannic/chromium | ab32e8aacb08c9fce0dc4bf09eec456ba46e3710 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2019-03-13T10:32:53.000Z | 2019-03-13T11:05:30.000Z | tools/android/customtabs_benchmark/scripts/customtabs_benchmark.py | Yannic/chromium | ab32e8aacb08c9fce0dc4bf09eec456ba46e3710 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Loops Custom Tabs tests and outputs the results into a CSV file."""
import collections
import contextlib
import logging
import o... | 40.404908 | 80 | 0.641436 |
import collections
import contextlib
import logging
import optparse
import os
import random
import re
import sys
import time
_SRC_PATH = os.path.abspath(os.path.join(
os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir))
sys.path.append(os.path.join(_SRC_PATH, 'third_party', 'catapult', 'devil... | true | true |
08f9b43b3ee2d591c95e9b44c230dafc9ce5fb6a | 10,817 | py | Python | Source/Common/wb_app.py | cadappl/scm-workbench | 302cdb8e36bb755f4977062e8977c37e7f4491f9 | [
"Apache-2.0"
] | null | null | null | Source/Common/wb_app.py | cadappl/scm-workbench | 302cdb8e36bb755f4977062e8977c37e7f4491f9 | [
"Apache-2.0"
] | null | null | null | Source/Common/wb_app.py | cadappl/scm-workbench | 302cdb8e36bb755f4977062e8977c37e7f4491f9 | [
"Apache-2.0"
] | null | null | null | '''
====================================================================
Copyright (c) 2003-2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
======================================================... | 33.180982 | 119 | 0.595914 | import sys
import os
import inspect
import gettext
import xml_preferences
from PyQt5 import QtWidgets
from PyQt5 import QtCore
from PyQt5 import QtGui
import wb_platform_specific
import wb_logging
import wb_background_thread
qt_event_type_names = {}
for name in dir(QtCore.QEvent):
value = getattr( QtCore.QEvent,... | true | true |
08f9b4914642c207fbf2a5a80f398396dd73dd5b | 4,116 | py | Python | src/service.py | ersilia-os/eos2ta5 | 013ac89843ce6ddb5256d7af1bdff266c5fedb7c | [
"MIT"
] | null | null | null | src/service.py | ersilia-os/eos2ta5 | 013ac89843ce6ddb5256d7af1bdff266c5fedb7c | [
"MIT"
] | null | null | null | src/service.py | ersilia-os/eos2ta5 | 013ac89843ce6ddb5256d7af1bdff266c5fedb7c | [
"MIT"
] | null | null | null | from typing import List
from bentoml import BentoService, api, artifacts
from bentoml.adapters import JsonInput
from bentoml.types import JsonSerializable
from bentoml.service import BentoServiceArtifact
import pickle
import os
import shutil
import collections
import tempfile
import subprocess
import csv
CHECKPOINTS... | 31.419847 | 73 | 0.62172 | from typing import List
from bentoml import BentoService, api, artifacts
from bentoml.adapters import JsonInput
from bentoml.types import JsonSerializable
from bentoml.service import BentoServiceArtifact
import pickle
import os
import shutil
import collections
import tempfile
import subprocess
import csv
CHECKPOINTS... | true | true |
08f9b4feac29b38a76162fa977187fe8d138eef2 | 11,197 | py | Python | amgut/test/test_add_sample.py | fedarko/american-gut-web | 9dbbbc49e6261f68fcbf18530137edc0d3073cd7 | [
"BSD-3-Clause"
] | 5 | 2015-02-10T18:01:12.000Z | 2021-01-15T16:19:00.000Z | amgut/test/test_add_sample.py | fedarko/american-gut-web | 9dbbbc49e6261f68fcbf18530137edc0d3073cd7 | [
"BSD-3-Clause"
] | 346 | 2015-01-03T00:12:17.000Z | 2019-11-20T00:51:16.000Z | amgut/test/test_add_sample.py | fedarko/american-gut-web | 9dbbbc49e6261f68fcbf18530137edc0d3073cd7 | [
"BSD-3-Clause"
] | 16 | 2015-11-10T21:53:52.000Z | 2019-10-21T18:00:47.000Z | from unittest import main
import datetime
from amgut.test.tornado_test_base import TestHandlerBase
from amgut.connections import ag_data
from tornado import escape
from amgut.lib.util import rollback
class TestAddSample(TestHandlerBase):
def test_get_not_authed(self):
response = self.get(
'/au... | 42.25283 | 79 | 0.576226 | from unittest import main
import datetime
from amgut.test.tornado_test_base import TestHandlerBase
from amgut.connections import ag_data
from tornado import escape
from amgut.lib.util import rollback
class TestAddSample(TestHandlerBase):
def test_get_not_authed(self):
response = self.get(
'/au... | true | true |
08f9b55839e5926a00a05e544b0bd59abc08d18d | 798 | py | Python | part2/seven/views.py | maucrodriguez/python-exercise | b6a17b5597f91513a9f6cfd5364ecacba877c6e5 | [
"MIT"
] | null | null | null | part2/seven/views.py | maucrodriguez/python-exercise | b6a17b5597f91513a9f6cfd5364ecacba877c6e5 | [
"MIT"
] | null | null | null | part2/seven/views.py | maucrodriguez/python-exercise | b6a17b5597f91513a9f6cfd5364ecacba877c6e5 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.contrib import messages
from .forms import SevenPairsForm
def find_pairs(number_list, total):
result = []
partials = {}
for n in number_list:
element = total -... | 28.5 | 78 | 0.650376 | from django.shortcuts import render
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.contrib import messages
from .forms import SevenPairsForm
def find_pairs(number_list, total):
result = []
partials = {}
for n in number_list:
element = total -... | true | true |
08f9b5a7d826377b8c0389fdd67052968bcaf404 | 3,577 | py | Python | src/loss.py | asafjo23/outliers-detection | dd78e3161c02a2f8ae685ef31ad796787e305591 | [
"MIT"
] | null | null | null | src/loss.py | asafjo23/outliers-detection | dd78e3161c02a2f8ae685ef31ad796787e305591 | [
"MIT"
] | 4 | 2022-03-28T08:53:39.000Z | 2022-03-28T09:00:27.000Z | src/loss.py | asafjo23/outliers-detection | dd78e3161c02a2f8ae685ef31ad796787e305591 | [
"MIT"
] | null | null | null | import torch.nn.functional as F
from tensorboardX import SummaryWriter
from torch import Tensor, clone, clip, round, abs, sub, sum, tensor
from torch.nn.modules.loss import _Loss
from src.model import GaussianHistogram
from src.utils import DataConverter, DataProcessor
class MiningOutliersLoss(_Loss):
def __ini... | 34.728155 | 100 | 0.630696 | import torch.nn.functional as F
from tensorboardX import SummaryWriter
from torch import Tensor, clone, clip, round, abs, sub, sum, tensor
from torch.nn.modules.loss import _Loss
from src.model import GaussianHistogram
from src.utils import DataConverter, DataProcessor
class MiningOutliersLoss(_Loss):
def __ini... | true | true |
08f9b5b1c6b15a71240f8f7aadf2d7654a91af42 | 3,731 | py | Python | iirsBenchmark/regressors/Linear_regressor.py | gAldeia/iirsBenchmark | 2211b4755405eb32178a09f1a01143d53dc6516d | [
"BSD-3-Clause"
] | null | null | null | iirsBenchmark/regressors/Linear_regressor.py | gAldeia/iirsBenchmark | 2211b4755405eb32178a09f1a01143d53dc6516d | [
"BSD-3-Clause"
] | null | null | null | iirsBenchmark/regressors/Linear_regressor.py | gAldeia/iirsBenchmark | 2211b4755405eb32178a09f1a01143d53dc6516d | [
"BSD-3-Clause"
] | null | null | null | # Author: Guilherme Aldeia
# Contact: guilherme.aldeia@ufabc.edu.br
# Version: 1.0.1
# Last modified: 21-11-2021 by Guilherme Aldeia
"""
Linear regressor. This method is considered a white-box for most authors.
This regressor extends the scikit-learn
[LinearRegression](https://scikit-learn.org/stable/module... | 36.940594 | 114 | 0.681319 |
from sklearn.linear_model import LinearRegression
import numpy as np
class Linear_regressor(LinearRegression):
def __init__(self, *,
fit_intercept=True, normalize=False, copy_X=True,
positive=False, **kwargs):
super(Linear_r... | true | true |
08f9b77b3b9943922bec7bfdff97184aed190a8a | 1,505 | py | Python | crafters/audio/AudioReader/__init__.py | strawberrypie/jina-hub | 8b2356d58687694d817881c840745214f12e94c4 | [
"Apache-2.0"
] | 106 | 2020-04-28T10:24:08.000Z | 2022-03-15T02:30:27.000Z | crafters/audio/AudioReader/__init__.py | strawberrypie/jina-hub | 8b2356d58687694d817881c840745214f12e94c4 | [
"Apache-2.0"
] | 6,808 | 2020-05-01T04:13:43.000Z | 2021-06-23T08:04:02.000Z | crafters/audio/AudioReader/__init__.py | strawberrypie/jina-hub | 8b2356d58687694d817881c840745214f12e94c4 | [
"Apache-2.0"
] | 86 | 2020-04-29T09:50:29.000Z | 2022-01-25T05:42:44.000Z | from typing import Dict
from jina.executors.crafters import BaseCrafter
from jina.executors.decorators import single
class AudioReader(BaseCrafter):
"""
Read and resample the audio signal on doc-level.
:class:`AudioReader` loads an audio file as `ndarray` and resamples the audio signal to the target sam... | 32.717391 | 116 | 0.65515 | from typing import Dict
from jina.executors.crafters import BaseCrafter
from jina.executors.decorators import single
class AudioReader(BaseCrafter):
def __init__(self, target_sample_rate: int = 22050, *args, **kwargs):
super().__init__(*args, **kwargs)
self.sample_rate = target_sample_rate
... | true | true |
08f9b8a2b08b7706a3faa170415f1a2c2daa127a | 2,957 | py | Python | instana/collector/helpers/fargate/task.py | tirkarthi/python-sensor | 9872d146ac00baff2673fde5ba97fdbe596869a4 | [
"MIT"
] | 2 | 2019-12-02T10:08:58.000Z | 2020-10-04T09:34:20.000Z | instana/collector/helpers/fargate/task.py | tirkarthi/python-sensor | 9872d146ac00baff2673fde5ba97fdbe596869a4 | [
"MIT"
] | 2 | 2020-06-09T12:24:54.000Z | 2021-03-15T12:49:15.000Z | instana/collector/helpers/fargate/task.py | takeaway/python-sensor | 52d6eaa2d6a8e625201bad36ac2448201c4bd63d | [
"MIT"
] | null | null | null | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2020
""" Module to assist in the data collection about the AWS Fargate task that is running this process """
from ....log import logger
from ..base import BaseHelper
from ....util import DictionaryOfStan
class TaskHelper(BaseHelper):
""" This class help... | 55.792453 | 120 | 0.592154 |
from ....log import logger
from ..base import BaseHelper
from ....util import DictionaryOfStan
class TaskHelper(BaseHelper):
def collect_metrics(self, with_snapshot=False):
plugins = []
try:
if self.collector.task_metadata is not None:
try:
plugin_... | true | true |
08f9b9dcb77dba2e502e75c74b6379a904287c36 | 3,964 | py | Python | examples/dcmotor.py | rgmaidana/stateEstimation | f8f4102a20ea6dfc9b466a291244fea4fa802dd4 | [
"MIT"
] | null | null | null | examples/dcmotor.py | rgmaidana/stateEstimation | f8f4102a20ea6dfc9b466a291244fea4fa802dd4 | [
"MIT"
] | null | null | null | examples/dcmotor.py | rgmaidana/stateEstimation | f8f4102a20ea6dfc9b466a291244fea4fa802dd4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
from stateEstimation import KF
from scipy.integrate import ode
import sys
# Parameters
sim_time = 10 # Simulation time
init_states = [0, 0] # Initial states
sensor_err = 0.2 # Introduce gaussian error in simulated sens... | 33.59322 | 104 | 0.553734 |
import numpy as np
from stateEstimation import KF
from scipy.integrate import ode
import sys
sim_time = 10 init_states = [0, 0] sensor_err = 0.2
class DCMotor:
def __init__(self, Ra=8, La=170e-3, J=10e-3, b=3e-3, If=0.5, kt=0.521, kw=0.521, T=0.001, **kw... | true | true |
08f9bbcd8f84be0512f46d6c4dcfb4c2e98e88d5 | 675 | py | Python | control.py | samilkorkmaz/FollowMarker | 313c67837bea0f365f0f06d30227ad00e0a45611 | [
"Apache-2.0"
] | null | null | null | control.py | samilkorkmaz/FollowMarker | 313c67837bea0f365f0f06d30227ad00e0a45611 | [
"Apache-2.0"
] | null | null | null | control.py | samilkorkmaz/FollowMarker | 313c67837bea0f365f0f06d30227ad00e0a45611 | [
"Apache-2.0"
] | null | null | null | Kp = 1.5 #proportionality constant
Ki = 0 #integral constant
integX = 0
integY = 0
def generateCommands(refLoc, currentLoc, timeStep_s):
global integX, integY
dx = refLoc[0] - currentLoc[0]
dy = refLoc[1] - currentLoc[1]
errorStr = "dx = %1.0f, dy = %1.0f" % (dx, dy)
propX = Kp*dx #proportional te... | 35.526316 | 65 | 0.671111 | Kp = 1.5 Ki = 0 integX = 0
integY = 0
def generateCommands(refLoc, currentLoc, timeStep_s):
global integX, integY
dx = refLoc[0] - currentLoc[0]
dy = refLoc[1] - currentLoc[1]
errorStr = "dx = %1.0f, dy = %1.0f" % (dx, dy)
propX = Kp*dx integX = integX + dx*timeStep_s forceX = propX + Ki*i... | true | true |
08f9bbe7ef55e38f910e7a79af2d6da290488f9b | 106,092 | py | Python | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Python/pkg_resources/__init__.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 1,738 | 2017-09-21T10:59:12.000Z | 2022-03-31T21:05:46.000Z | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Python/pkg_resources/__init__.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | dev/Gems/CloudGemDefectReporter/v1/AWS/common-code/Python/pkg_resources/__init__.py | jeikabu/lumberyard | 07228c605ce16cbf5aaa209a94a3cb9d6c1a4115 | [
"AML"
] | 671 | 2017-09-21T08:04:01.000Z | 2022-03-29T14:30:07.000Z | # coding: utf-8
"""
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path opera... | 33.30989 | 79 | 0.618557 |
from __future__ import absolute_import
import sys
import os
import io
import time
import re
import types
import zipfile
import zipimport
import warnings
import stat
import functools
import pkgutil
import operator
import platform
import collections
import plistlib
import email.parser
import errno
import tempfile
impor... | true | true |
08f9bd51de77b82c646f2432624b4fb1d3d9359d | 44,988 | py | Python | pandas/core/indexes/interval.py | kritikashah20/pandas | 309018c7ce7e9e31708f58af971ed92823921493 | [
"BSD-3-Clause"
] | 1 | 2020-09-03T13:24:57.000Z | 2020-09-03T13:24:57.000Z | pandas/core/indexes/interval.py | FisherBao/pandas | 361166f86da1a665a1b5808e0935c28f8cf56d34 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/interval.py | FisherBao/pandas | 361166f86da1a665a1b5808e0935c28f8cf56d34 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-11-20T18:19:33.000Z | 2020-11-20T18:19:33.000Z | """ define the IntervalIndex """
from operator import le, lt
import textwrap
from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union, cast
import numpy as np
from pandas._config import get_option
from pandas._libs import lib
from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
from pan... | 33.598208 | 96 | 0.59218 | from operator import le, lt
import textwrap
from typing import TYPE_CHECKING, Any, List, Optional, Tuple, Union, cast
import numpy as np
from pandas._config import get_option
from pandas._libs import lib
from pandas._libs.interval import Interval, IntervalMixin, IntervalTree
from pandas._libs.tslibs import BaseOffse... | true | true |
08f9bd57bf617943a48394604c67a7001783eeee | 44,978 | py | Python | smoke/cli.py | DunnCreativeSS/smoke-python | e1eeeebf0094b6a0365837bb33c593339e3d2389 | [
"MIT"
] | 1 | 2019-11-10T06:54:42.000Z | 2019-11-10T06:54:42.000Z | smoke/cli.py | DunnCreativeSS/smoke-python | e1eeeebf0094b6a0365837bb33c593339e3d2389 | [
"MIT"
] | null | null | null | smoke/cli.py | DunnCreativeSS/smoke-python | e1eeeebf0094b6a0365837bb33c593339e3d2389 | [
"MIT"
] | 1 | 2019-11-10T06:54:50.000Z | 2019-11-10T06:54:50.000Z | import argparse
import json
import logging
import os
import pkg_resources
import pprint
import re
import steem as stm
import sys
from prettytable import PrettyTable
from smokebase.storage import configStorage
from smokebase.account import PrivateKey
from .account import Account
from .amount import Amount
from .block ... | 34.705247 | 79 | 0.567922 | import argparse
import json
import logging
import os
import pkg_resources
import pprint
import re
import steem as stm
import sys
from prettytable import PrettyTable
from smokebase.storage import configStorage
from smokebase.account import PrivateKey
from .account import Account
from .amount import Amount
from .block ... | true | true |
08f9be21ada910e30815a5b0b9ccac2223eb48df | 4,797 | py | Python | ParlAI/parlai/tasks/clinical_trials/data_process.py | Qdata4Capstone/MedTrialConnect | fe0ec0d35d6c720fcf0a35b477d2d303fd3d42b0 | [
"MIT"
] | 1 | 2019-11-08T18:38:42.000Z | 2019-11-08T18:38:42.000Z | ParlAI/parlai/tasks/clinical_trials/data_process.py | Qdata4Capstone/MedTrialConnect | fe0ec0d35d6c720fcf0a35b477d2d303fd3d42b0 | [
"MIT"
] | 3 | 2021-05-08T09:44:24.000Z | 2021-07-21T14:03:28.000Z | ParlAI/parlai/tasks/clinical_trials/data_process.py | Qdata4Capstone/MedTrialConnect | fe0ec0d35d6c720fcf0a35b477d2d303fd3d42b0 | [
"MIT"
] | null | null | null | from .xml_parser import ClinicalTrialParseException, ProcessedClinicalTrial
from timeit import default_timer as timer
import os
import sys
import json
import string
import datetime
import unicodedata
import traceback
import xml.etree.ElementTree as ET
'''
* After downloaded from clinicaltrials.gov and extracted, fil... | 36.9 | 136 | 0.634772 | from .xml_parser import ClinicalTrialParseException, ProcessedClinicalTrial
from timeit import default_timer as timer
import os
import sys
import json
import string
import datetime
import unicodedata
import traceback
import xml.etree.ElementTree as ET
def xml2json(xml_dir, json_dir):
if not os.path.exists(json_dir)... | true | true |
08f9be668d83f2c47c8d0fc49d115ca7110e0ef9 | 8,911 | py | Python | py/HW3/option_models/sabr.py | jiangxunmu/ASP | cb12bcd7bf30cc28c09b3d3c10a40fa5dc8c9dc7 | [
"MIT"
] | null | null | null | py/HW3/option_models/sabr.py | jiangxunmu/ASP | cb12bcd7bf30cc28c09b3d3c10a40fa5dc8c9dc7 | [
"MIT"
] | null | null | null | py/HW3/option_models/sabr.py | jiangxunmu/ASP | cb12bcd7bf30cc28c09b3d3c10a40fa5dc8c9dc7 | [
"MIT"
] | 1 | 2021-12-13T13:23:40.000Z | 2021-12-13T13:23:40.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Oct 10
@author: jaehyuk
"""
import numpy as np
import scipy.stats as ss
import scipy.optimize as sopt
from . import normal
from . import bsm
import pyfeng as pf
'''
MC model class for Beta=1
'''
class ModelBsmMC:
beta = 1.0 # fixed (not used)
vov, rho = 0.0, 0... | 35.931452 | 155 | 0.560319 |
import numpy as np
import scipy.stats as ss
import scipy.optimize as sopt
from . import normal
from . import bsm
import pyfeng as pf
class ModelBsmMC:
beta = 1.0 vov, rho = 0.0, 0.0
sigma, intr, divr = None, None, None
bsm_model = None
def __init__(self, sigma, vov=0, rho=0.0, beta=1.0,... | true | true |
08f9bf5b8049464e6f29525a0f9252741442e47b | 14,998 | py | Python | dns/rdataset.py | mathiasertl/dnspython | 450676b86f1123d988cfac0016e40f65ccd66faa | [
"ISC"
] | null | null | null | dns/rdataset.py | mathiasertl/dnspython | 450676b86f1123d988cfac0016e40f65ccd66faa | [
"ISC"
] | null | null | null | dns/rdataset.py | mathiasertl/dnspython | 450676b86f1123d988cfac0016e40f65ccd66faa | [
"ISC"
] | null | null | null | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2001-2017 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permis... | 32.604348 | 79 | 0.589812 |
import io
import random
import struct
import dns.exception
import dns.immutable
import dns.rdatatype
import dns.rdataclass
import dns.rdata
import dns.set
SimpleSet = dns.set.Set
class DifferingCovers(dns.exception.DNSException):
class IncompatibleTypes(dns.exception.DNSException):
class Rdataset(dns.set.Set... | true | true |
08f9c0a3029e4f4e34b0692fc72b686d89e3e846 | 718 | py | Python | sustainerds/api/persistence.py | elbart/sustainerds | 371a6e5ae2538a243d302644964fa4bb5d462b14 | [
"MIT"
] | null | null | null | sustainerds/api/persistence.py | elbart/sustainerds | 371a6e5ae2538a243d302644964fa4bb5d462b14 | [
"MIT"
] | 1 | 2020-03-31T07:06:09.000Z | 2020-03-31T07:06:09.000Z | sustainerds/api/persistence.py | elbart/sustainerds | 371a6e5ae2538a243d302644964fa4bb5d462b14 | [
"MIT"
] | null | null | null | import time
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.schema import MetaData
from sustainerds.api.core.persistence import BaseModel
NAMING_CONVENTION = {
"ix": "ix_%(column_0_label)s",
"uq": "uq_%(table_name)s_%(column_0_name)s",
"ck": "ck_%(table_name)s_%(constraint_name)s... | 29.916667 | 91 | 0.727019 | import time
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.schema import MetaData
from sustainerds.api.core.persistence import BaseModel
NAMING_CONVENTION = {
"ix": "ix_%(column_0_label)s",
"uq": "uq_%(table_name)s_%(column_0_name)s",
"ck": "ck_%(table_name)s_%(constraint_name)s... | true | true |
08f9c19fa671de52109df4bec1481d8b44b3eaea | 2,038 | py | Python | river/optim/initializers.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 1,105 | 2019-01-24T15:15:30.000Z | 2020-11-10T18:27:00.000Z | river/optim/initializers.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 328 | 2019-01-25T13:48:43.000Z | 2020-11-11T11:41:44.000Z | river/optim/initializers.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 150 | 2019-01-29T19:05:21.000Z | 2020-11-11T11:50:14.000Z | """Weight initializers."""
import numpy as np
from river.optim.base import Initializer
__all__ = ["Constant", "Normal", "Zeros"]
class Constant(Initializer):
"""Constant initializer which always returns the same value.
Parameters
----------
value
Examples
--------
>>... | 20.795918 | 97 | 0.565751 | import numpy as np
from river.optim.base import Initializer
__all__ = ["Constant", "Normal", "Zeros"]
class Constant(Initializer):
def __init__(self, value: float):
self.value = value
def __call__(self, shape=1):
return np.full(shape, self.value, dtype=float) if shape != 1 els... | true | true |
08f9c243baeeb2b44d216377264ab5fb63b31e3d | 344 | py | Python | scripts/calk1_result.py | kinnamirobo/ros_kadai2 | 2fb389188cb6bc4fb887fa8bd5f2cfd1fefcf61d | [
"BSD-3-Clause"
] | null | null | null | scripts/calk1_result.py | kinnamirobo/ros_kadai2 | 2fb389188cb6bc4fb887fa8bd5f2cfd1fefcf61d | [
"BSD-3-Clause"
] | null | null | null | scripts/calk1_result.py | kinnamirobo/ros_kadai2 | 2fb389188cb6bc4fb887fa8bd5f2cfd1fefcf61d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import subprocess
import rospy
from std_msgs.msg import Int32
def cb(message):
if message.data == 1:
rospy.loginfo("corect")
elif message.data == 2:
rospy.loginfo("incorect")
if __name__ == "__main__":
rospy.init_node('answer')
sub = rospy.Subscriber('cal', Int3... | 20.235294 | 44 | 0.651163 |
import subprocess
import rospy
from std_msgs.msg import Int32
def cb(message):
if message.data == 1:
rospy.loginfo("corect")
elif message.data == 2:
rospy.loginfo("incorect")
if __name__ == "__main__":
rospy.init_node('answer')
sub = rospy.Subscriber('cal', Int32, cb)
rospy.spin()... | true | true |
08f9c39606b183a296f636b8d31b4be4075aa7ef | 7,742 | py | Python | tests/bugs/core_3658_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_3658_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | tests/bugs/core_3658_test.py | reevespaul/firebird-qa | 98f16f425aa9ab8ee63b86172f959d63a2d76f21 | [
"MIT"
] | null | null | null | #coding:utf-8
#
# id: bugs.core_3658
# title: FBSVCMGR connects to server as OS user name rather than value of ISC_USER environment variable
# decription:
# ### W A R N I N G ###
# 1) This test uses asynchronous call of external routine (fbsvcmgr) using subpro... | 37.400966 | 160 | 0.570266 |
import pytest
from firebird.qa import db_factory, isql_act, Action
substitutions_1 = []
init_script_1 = """"""
db_1 = db_factory(sql_dialect=3, init=init_script_1)
# # first do f.flush(), and
# # then do os.fsync(f.fileno()), to ensure that all internal buffers associated with f are written to disk.
# ... | true | true |
08f9c41e0a66d3b953add6eb70a25835a0d9b6a0 | 792 | py | Python | compy/image/errors.py | tilleyd/compy | b63188341d0c66c0ecd810e29918e569c519b296 | [
"MIT"
] | null | null | null | compy/image/errors.py | tilleyd/compy | b63188341d0c66c0ecd810e29918e569c519b296 | [
"MIT"
] | null | null | null | compy/image/errors.py | tilleyd/compy | b63188341d0c66c0ecd810e29918e569c519b296 | [
"MIT"
] | null | null | null | """Contains custom exception classes."""
import numpy as np
from typing import Union, List, Optional
class ImageError(Exception):
"""Parent class of all image related errors."""
def __init__(self, message):
super().__init__(message)
class ImageDataTypeError(ImageError):
"""Error if image has i... | 25.548387 | 87 | 0.643939 |
import numpy as np
from typing import Union, List, Optional
class ImageError(Exception):
def __init__(self, message):
super().__init__(message)
class ImageDataTypeError(ImageError):
def __init__(
self,
dtype_got: np.dtype,
dtype_expected: Union[np.dtype, List[np.dtype]],
... | true | true |
08f9c67f46f130399ea45ad86064095d81588c8e | 379 | py | Python | theheck/rules/git_branch_list.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | theheck/rules/git_branch_list.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | theheck/rules/git_branch_list.py | jlandrum/theheck | d2c008b6ca14220504be95f887253ddd9f5e9f72 | [
"MIT"
] | null | null | null | from theheck.shells import shell
from theheck.specific.git import git_support
@git_support
def match(command):
# catches "git branch list" in place of "git branch"
return (command.script_parts
and command.script_parts[1:] == 'branch list'.split())
@git_support
def get_new_command(command):
r... | 25.266667 | 66 | 0.720317 | from theheck.shells import shell
from theheck.specific.git import git_support
@git_support
def match(command):
return (command.script_parts
and command.script_parts[1:] == 'branch list'.split())
@git_support
def get_new_command(command):
return shell.and_('git branch --delete list', 'git bra... | true | true |
08f9c6eff415d6869b3b497e5e5a172af129de82 | 676 | py | Python | python_modules/dagster/dagster_tests/core_tests/instance_tests/test_instance_config.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | 2 | 2021-06-21T17:50:26.000Z | 2021-06-21T19:14:23.000Z | python_modules/dagster/dagster_tests/core_tests/instance_tests/test_instance_config.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | python_modules/dagster/dagster_tests/core_tests/instance_tests/test_instance_config.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | 1 | 2021-08-18T17:21:57.000Z | 2021-08-18T17:21:57.000Z | import re
import pytest
from dagster import file_relative_path
from dagster.core.instance.config import dagster_instance_config
@pytest.mark.parametrize("config_filename", ("dagster.yaml", "something.yaml"))
def test_instance_yaml_config_not_set(config_filename):
base_dir = file_relative_path(__file__, ".")
... | 30.727273 | 79 | 0.690828 | import re
import pytest
from dagster import file_relative_path
from dagster.core.instance.config import dagster_instance_config
@pytest.mark.parametrize("config_filename", ("dagster.yaml", "something.yaml"))
def test_instance_yaml_config_not_set(config_filename):
base_dir = file_relative_path(__file__, ".")
... | true | true |
08f9c77214ccce4bee22ba03fda0d273ea9ca024 | 1,905 | py | Python | reader.py | Marius-Juston/ece408_project | 9d87e16870b7b61aa6ed1740058f03c406affe57 | [
"NCSA"
] | 65 | 2018-03-01T15:52:01.000Z | 2022-03-18T05:25:13.000Z | reader.py | Marius-Juston/ece408_project | 9d87e16870b7b61aa6ed1740058f03c406affe57 | [
"NCSA"
] | 7 | 2018-05-11T19:56:48.000Z | 2020-10-12T19:58:58.000Z | reader.py | Marius-Juston/ece408_project | 9d87e16870b7b61aa6ed1740058f03c406affe57 | [
"NCSA"
] | 117 | 2018-02-14T17:40:28.000Z | 2022-01-26T10:23:52.000Z | def load_mnist(path, rows, cols, kind):
import os
import gzip
import numpy as np
filters = 1
"""Load MNIST data from `path`"""
labels_path = os.path.join(path,
'%s-labels-idx1-ubyte.gz'
% kind)
images_path = os.path.join(path,
... | 32.844828 | 83 | 0.527034 | def load_mnist(path, rows, cols, kind):
import os
import gzip
import numpy as np
filters = 1
labels_path = os.path.join(path,
'%s-labels-idx1-ubyte.gz'
% kind)
images_path = os.path.join(path,
'%s-imag... | true | true |
08f9c79238759e2c513f6c666fb32aafa9165852 | 11,244 | py | Python | cirq/circuits/text_diagram_drawer.py | muneerqu/Cirq | 729d993312467d8ea9127103f9e15ae2391e7d85 | [
"Apache-2.0"
] | 1 | 2019-09-04T16:55:30.000Z | 2019-09-04T16:55:30.000Z | cirq/circuits/text_diagram_drawer.py | 1eedaegon/Cirq | de0c5e855069bba71e55b070fc9b06f58c07a861 | [
"Apache-2.0"
] | null | null | null | cirq/circuits/text_diagram_drawer.py | 1eedaegon/Cirq | de0c5e855069bba71e55b070fc9b06f58c07a861 | [
"Apache-2.0"
] | 1 | 2018-10-25T19:36:50.000Z | 2018-10-25T19:36:50.000Z | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 37.108911 | 80 | 0.566969 | from typing import (Callable, cast, Dict, List, Optional, NamedTuple, Tuple,
Union)
import numpy as np
from cirq.circuits._block_diagram_drawer import BlockDiagramDrawer
from cirq.circuits._box_drawing_character_data import (
BoxDrawCharacterSet,
NORMAL_BOX_CHARS,
BOLD_BOX_CHARS,
A... | true | true |
08f9c7952bb32ebc496954554731a47af504dd96 | 5,682 | py | Python | documentation/source/conf.py | soasis/cuneicode | 0f9f4711b659eaeafeb63a88a9e407ad2400547b | [
"Apache-2.0"
] | 4 | 2021-11-21T00:19:51.000Z | 2022-03-18T16:43:12.000Z | documentation/source/conf.py | soasis/cuneicode | 0f9f4711b659eaeafeb63a88a9e407ad2400547b | [
"Apache-2.0"
] | 2 | 2021-11-20T22:33:49.000Z | 2021-11-21T08:06:57.000Z | documentation/source/conf.py | soasis/cuneicode | 0f9f4711b659eaeafeb63a88a9e407ad2400547b | [
"Apache-2.0"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
... | 39.458333 | 435 | 0.691306 |
import os
import sys
import subprocess
import typing
project = 'ztd.cuneicode'
copyright = "2021, ThePhD & Shepherd's Oasis, LLC"
author = "ThePhD & Shepherd's Oasis, LLC"
release = '0.0.0'
extensions = ['breathe', 'sphinx.ext.autosectionlabel']
templates_path = ['_templates']
exclude_patter... | true | true |
08f9c9377a8163214df234cd68eeca5cd60793e5 | 485 | py | Python | tests/test_user.py | MugeraH/Letewaa | 3067ab183cf814a670930236992f8fadc78dd3e7 | [
"MIT"
] | null | null | null | tests/test_user.py | MugeraH/Letewaa | 3067ab183cf814a670930236992f8fadc78dd3e7 | [
"MIT"
] | 1 | 2021-05-06T18:52:24.000Z | 2021-05-06T18:52:24.000Z | tests/test_user.py | MugeraH/Letewaa | 3067ab183cf814a670930236992f8fadc78dd3e7 | [
"MIT"
] | 2 | 2021-05-05T22:58:21.000Z | 2021-07-19T20:44:04.000Z | import unittest
from app.models import User
class SellerModelTest(unittest.TestCase):
def setUp(self):
self.new_User(password='banana')
def test_password_setter(self):
self.assertTrue(self.new_user.password is not None)
def test_no_access_password(self):
with self.assertRaises(At... | 28.529412 | 68 | 0.71134 | import unittest
from app.models import User
class SellerModelTest(unittest.TestCase):
def setUp(self):
self.new_User(password='banana')
def test_password_setter(self):
self.assertTrue(self.new_user.password is not None)
def test_no_access_password(self):
with self.assertRaises(At... | true | true |
08f9c9912cf570c312907f920e386eee8977cf45 | 505 | py | Python | proxy/quickstart/create-participant/create-participant.6.x.py | shaileshn/api-snippets | 08826972154634335378fed0edd2707d7f62b03b | [
"MIT"
] | null | null | null | proxy/quickstart/create-participant/create-participant.6.x.py | shaileshn/api-snippets | 08826972154634335378fed0edd2707d7f62b03b | [
"MIT"
] | null | null | null | proxy/quickstart/create-participant/create-participant.6.x.py | shaileshn/api-snippets | 08826972154634335378fed0edd2707d7f62b03b | [
"MIT"
] | 1 | 2019-10-02T14:36:36.000Z | 2019-10-02T14:36:36.000Z | # Get the Node helper library from https://twilio.com/docs/libraries/python
from twilio.rest import Client
# Get your Account SID and Auth Token from https://twilio.com/console
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)
participant = client.preview.proxy ... | 36.071429 | 75 | 0.782178 | from twilio.rest import Client
account = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
token = "your_auth_token"
client = Client(account, token)
participant = client.preview.proxy \
.services("KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.sessions("KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") \
.participants.create(identifier=... | true | true |
08f9ca79b7681fdd90a91c3958bc6edb780a522e | 2,525 | py | Python | obtainCSVtable.py | anege/launchcontainers | 7d26e09edb1e737d5231366c4d0b8da6973d0ad7 | [
"MIT"
] | null | null | null | obtainCSVtable.py | anege/launchcontainers | 7d26e09edb1e737d5231366c4d0b8da6973d0ad7 | [
"MIT"
] | null | null | null | obtainCSVtable.py | anege/launchcontainers | 7d26e09edb1e737d5231366c4d0b8da6973d0ad7 | [
"MIT"
] | 3 | 2021-11-29T14:38:48.000Z | 2022-03-23T10:28:33.000Z | dt = pd.read_csv(subseslist, sep=",", header=0)
rowind = 0
for index in dt.index:
sub = dt.loc[index, 'sub']
ses = dt.loc[index, 'ses']
dwi = dt.loc[index, 'dwi']
for meas in meass:
if dwi:
tmpfname = os.path.join('sub-'+sub,'ses-'+ses,'output','RTP_'+meas+'.csv')
tmp = pd.read_csv(... | 58.72093 | 462 | 0.626931 | dt = pd.read_csv(subseslist, sep=",", header=0)
rowind = 0
for index in dt.index:
sub = dt.loc[index, 'sub']
ses = dt.loc[index, 'ses']
dwi = dt.loc[index, 'dwi']
for meas in meass:
if dwi:
tmpfname = os.path.join('sub-'+sub,'ses-'+ses,'output','RTP_'+meas+'.csv')
tmp = pd.read_csv(... | true | true |
08f9caed3a8e73cd0cd6b5384d54a5cfcd8c83af | 184 | py | Python | djangocms_versioning/test_utils/polls/cms_wizards.py | NarenderRajuB/djangocms-versioning | aa7a16fe275a6d8a41781ffb1e10427de917c2d5 | [
"BSD-3-Clause"
] | 12 | 2018-09-04T10:33:16.000Z | 2021-09-07T14:30:12.000Z | djangocms_versioning/test_utils/polls/cms_wizards.py | NarenderRajuB/djangocms-versioning | aa7a16fe275a6d8a41781ffb1e10427de917c2d5 | [
"BSD-3-Clause"
] | 46 | 2018-07-31T08:45:17.000Z | 2021-09-08T15:45:05.000Z | djangocms_versioning/test_utils/polls/cms_wizards.py | NarenderRajuB/djangocms-versioning | aa7a16fe275a6d8a41781ffb1e10427de917c2d5 | [
"BSD-3-Clause"
] | 16 | 2018-08-30T19:08:45.000Z | 2021-07-13T11:31:43.000Z | from cms.wizards.wizard_base import Wizard
from .forms import PollForm
class PollWizard(Wizard):
pass
poll_wizard = PollWizard(title="Poll Wizard", weight=120, form=PollForm)
| 16.727273 | 72 | 0.771739 | from cms.wizards.wizard_base import Wizard
from .forms import PollForm
class PollWizard(Wizard):
pass
poll_wizard = PollWizard(title="Poll Wizard", weight=120, form=PollForm)
| true | true |
08f9cb02ea7d76eb3e0122a76789ef46d494014e | 1,106 | py | Python | py/pyis-torch/tests/test_text_featurizers/test_regex_featurizer.py | microsoft/python-inference-script | cbbbe9d16be0839e4df357b1bd9e8274ca44f1f7 | [
"MIT"
] | 5 | 2021-11-29T01:49:22.000Z | 2022-02-23T10:26:46.000Z | py/pyis-torch/tests/test_text_featurizers/test_regex_featurizer.py | microsoft/python-inference-script | cbbbe9d16be0839e4df357b1bd9e8274ca44f1f7 | [
"MIT"
] | 1 | 2021-11-01T02:22:32.000Z | 2021-11-01T02:22:32.000Z | py/pyis-torch/tests/test_text_featurizers/test_regex_featurizer.py | microsoft/python-inference-script | cbbbe9d16be0839e4df357b1bd9e8274ca44f1f7 | [
"MIT"
] | null | null | null | #################################################################
# WARNING: Auto-Generated File
# This file was generated by a tool(py/pyis-torch/code_gen.py)
# Any changes made to it will be overwritten when regenerated
#################################################################
# Copyright (c) ... | 36.866667 | 89 | 0.566908 |
import unittest, os
from pyis.torch import ops
from pyis.torch import save
class TestRegexFeaturizer(unittest.TestCase):
def test_run(self):
featurizer = ops.RegexFeaturizer(['\d+', r'\d+:\d+'])
features = featurizer.transform(['the', 'answer', 'is', '42'])
self.assertTrue(len(features),... | true | true |
08f9cbd37c5be54436e670516dbb9d64cc66e278 | 1,544 | py | Python | Tensile/Tests/pre_checkin/float_complex/test_float_complex.py | rosenrodt/Tensile | a190402a0ae139ef422e2b63d4093218a74dbdd9 | [
"MIT"
] | null | null | null | Tensile/Tests/pre_checkin/float_complex/test_float_complex.py | rosenrodt/Tensile | a190402a0ae139ef422e2b63d4093218a74dbdd9 | [
"MIT"
] | null | null | null | Tensile/Tests/pre_checkin/float_complex/test_float_complex.py | rosenrodt/Tensile | a190402a0ae139ef422e2b63d4093218a74dbdd9 | [
"MIT"
] | null | null | null | import Tensile.Tensile as Tensile
def test_cgemm_asm(tmpdir):
Tensile.Tensile([Tensile.TensileTestPath("pre_checkin/float_complex/cgemm_asm.yaml"), tmpdir.strpath])
def test_cgemm_hip_source_nn(tmpdir):
Tensile.Tensile([Tensile.TensileTestPath("pre_checkin/float_complex/cgemm_hip_source_nn.yaml"), tmpdir.strpath])
... | 48.25 | 113 | 0.841321 | import Tensile.Tensile as Tensile
def test_cgemm_asm(tmpdir):
Tensile.Tensile([Tensile.TensileTestPath("pre_checkin/float_complex/cgemm_asm.yaml"), tmpdir.strpath])
def test_cgemm_hip_source_nn(tmpdir):
Tensile.Tensile([Tensile.TensileTestPath("pre_checkin/float_complex/cgemm_hip_source_nn.yaml"), tmpdir.strpath])
... | true | true |
08f9cc4eda1266bddbdfb504d8b811e8a4935691 | 18,429 | py | Python | src/cultionet/scripts/cultionet.py | jgrss/cultionet | 91d2104aecaec3c8baace55915cf3a74492a3540 | [
"Apache-2.0"
] | null | null | null | src/cultionet/scripts/cultionet.py | jgrss/cultionet | 91d2104aecaec3c8baace55915cf3a74492a3540 | [
"Apache-2.0"
] | null | null | null | src/cultionet/scripts/cultionet.py | jgrss/cultionet | 91d2104aecaec3c8baace55915cf3a74492a3540 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import argparse
import typing as T
import logging
from pathlib import Path
from datetime import datetime
import cultionet
from cultionet.data.datasets import EdgeDataset
from cultionet.utils.project_paths import setup_paths
from cultionet.utils.normalize import get_norm_values
from cultionet.dat... | 36.784431 | 119 | 0.56308 |
import argparse
import typing as T
import logging
from pathlib import Path
from datetime import datetime
import cultionet
from cultionet.data.datasets import EdgeDataset
from cultionet.utils.project_paths import setup_paths
from cultionet.utils.normalize import get_norm_values
from cultionet.data.create import create... | true | true |
08f9ccdd9051c6bbdd14dbe7d3a06cb7147a02ab | 13,208 | py | Python | spinup/algos/rdpg/rdpg.py | rahulk29/spinningup | e5dbcead0d0cf9b2ab086d47add13f4944dc28cc | [
"MIT"
] | 1 | 2019-11-26T00:29:31.000Z | 2019-11-26T00:29:31.000Z | spinup/algos/rdpg/rdpg.py | rahulk29/spinningup | e5dbcead0d0cf9b2ab086d47add13f4944dc28cc | [
"MIT"
] | null | null | null | spinup/algos/rdpg/rdpg.py | rahulk29/spinningup | e5dbcead0d0cf9b2ab086d47add13f4944dc28cc | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn.functional as F
import gym
import time
from copy import deepcopy
from spinup.algos.rdpg.memory import ReplayBuffer
from spinup.algos.rdpg.model import Actor, Critic, soft_update
from spinup.utils.logx_torch import EpochLogger
from torch.autograd import Variable
def rdpg... | 39.426866 | 120 | 0.594185 | import numpy as np
import torch
import torch.nn.functional as F
import gym
import time
from copy import deepcopy
from spinup.algos.rdpg.memory import ReplayBuffer
from spinup.algos.rdpg.model import Actor, Critic, soft_update
from spinup.utils.logx_torch import EpochLogger
from torch.autograd import Variable
def rdpg... | true | true |
08f9cd46b02604b1ac7d1e28edaf07c9490f52f5 | 1,554 | py | Python | servo/data/poppy_r0.py | neverware-mirrors/hdctools | dd7f911bb9051e615af7fcb71d921bd481f934fb | [
"BSD-3-Clause"
] | null | null | null | servo/data/poppy_r0.py | neverware-mirrors/hdctools | dd7f911bb9051e615af7fcb71d921bd481f934fb | [
"BSD-3-Clause"
] | null | null | null | servo/data/poppy_r0.py | neverware-mirrors/hdctools | dd7f911bb9051e615af7fcb71d921bd481f934fb | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
inas = [
('ina3221', '0x40:0', 'pp3300_dsw_ec', 3.3, 1.000, 'rem', True),
('ina3221', '0x40:1', 'pp3300_dx_wlan', 3.3, 0.050, 'rem', ... | 62.16 | 76 | 0.508366 |
inas = [
('ina3221', '0x40:0', 'pp3300_dsw_ec', 3.3, 1.000, 'rem', True),
('ina3221', '0x40:1', 'pp3300_dx_wlan', 3.3, 0.050, 'rem', True),
('ina3221', '0x40:2', 'pp3300_dx_edp', 3.3, 0.100, 'rem', True),
('ina3221', '0x41:0', 'pp3300_dsw', 3.3, 0.020, 'rem', True),
... | true | true |
08f9ce5c815b37c2100b0d82b63f6bff1fe82e14 | 5,765 | py | Python | test/integration/smoke/test_scale_vm.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/smoke/test_scale_vm.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/smoke/test_scale_vm.py | redbridge/cloudstack | 2218053fb11d501950e4beb80e9bee4ae472b5b4 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.315476 | 120 | 0.63209 | import marvin
from marvin.codes import FAILED
from marvin.cloudstackTestCase import *
from marvin.cloudstackAPI import *
from marvin.lib.utils import *
from marvin.lib.base import *
from marvin.lib.common import *
from nose.plugins.attrib import attr
_multiprocess_shared_ = True
class TestScaleVm(cloudstackTestCase):... | true | true |
08f9cfbd9d794296388ad06377e35153b54e4702 | 2,089 | py | Python | index.py | marcelocostabr/dolar-to-real | da32118cc17d5622964740f12f00619da1bc3453 | [
"MIT"
] | 3 | 2019-04-04T11:40:29.000Z | 2019-05-06T17:16:33.000Z | index.py | marcelocostabr/dolar-to-real | da32118cc17d5622964740f12f00619da1bc3453 | [
"MIT"
] | null | null | null | index.py | marcelocostabr/dolar-to-real | da32118cc17d5622964740f12f00619da1bc3453 | [
"MIT"
] | 1 | 2019-04-15T16:08:06.000Z | 2019-04-15T16:08:06.000Z | import json
import requests
from datetime import date
from datetime import datetime, timedelta
# Dado um número de versão MAJOR.MINOR.PATCH, incremente a:
# 1. versão Maior(MAJOR): uma realmente nova versão,
# 2. versão Menor(MINOR): quando adicionar funcionalidades mantendo compatibilidade, e
# 3. versão de Correção(... | 30.275362 | 179 | 0.652944 | import json
import requests
from datetime import date
from datetime import datetime, timedelta
version = '1.0.1'
dolar = eval(input('Digite o total em $USD: '))
today = date.today()
weekday = today.isoweekday()
if (weekday == 1):
now = datetime.now()
workday = now - timedelta(days=3)
day = workday.st... | true | true |
08f9cffb53564b42e9f5795672b605c41dc1a704 | 507 | py | Python | odata/migrations/0005_auto_20211219_2053.py | krishnaansh/djongo-mongo | af0afd7a9028b91eeca520c4c558c026a92971ac | [
"MIT"
] | 1 | 2021-03-17T21:37:53.000Z | 2021-03-17T21:37:53.000Z | odata/migrations/0005_auto_20211219_2053.py | krishnaansh/djongo-mongo | af0afd7a9028b91eeca520c4c558c026a92971ac | [
"MIT"
] | null | null | null | odata/migrations/0005_auto_20211219_2053.py | krishnaansh/djongo-mongo | af0afd7a9028b91eeca520c4c558c026a92971ac | [
"MIT"
] | 1 | 2021-03-02T19:35:18.000Z | 2021-03-02T19:35:18.000Z | # Generated by Django 3.0.5 on 2021-12-19 15:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('odata', '0004_auto_20211219_2052'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='category_id... | 22.043478 | 63 | 0.573964 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('odata', '0004_auto_20211219_2052'),
]
operations = [
migrations.RemoveField(
model_name='product',
name='category_id',
),
migrations.AddField(
... | true | true |
08f9d05b8cc4254eefbf997df474763a2b7765c7 | 6,824 | py | Python | salad/schema_salad/sourceline.py | bogdang989/cwl-v1.1 | 9b3456a1bd24f1d19e4300ab90e1e2937129dc42 | [
"Apache-2.0"
] | null | null | null | salad/schema_salad/sourceline.py | bogdang989/cwl-v1.1 | 9b3456a1bd24f1d19e4300ab90e1e2937129dc42 | [
"Apache-2.0"
] | null | null | null | salad/schema_salad/sourceline.py | bogdang989/cwl-v1.1 | 9b3456a1bd24f1d19e4300ab90e1e2937129dc42 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import ruamel.yaml
from ruamel.yaml.comments import CommentedBase, CommentedMap, CommentedSeq
import re
import os
import traceback
from typing import (Any, AnyStr, Callable, cast, Dict, List, Iterable, Tuple,
TypeVar, Union, Text)
import six
lineno_re = re.co... | 36.491979 | 159 | 0.525498 | from __future__ import absolute_import
import ruamel.yaml
from ruamel.yaml.comments import CommentedBase, CommentedMap, CommentedSeq
import re
import os
import traceback
from typing import (Any, AnyStr, Callable, cast, Dict, List, Iterable, Tuple,
TypeVar, Union, Text)
import six
lineno_re = re.co... | true | true |
08f9d0b02ef788b85d5b33aa53d7dd01105f6ad0 | 7,874 | py | Python | spec.py | rakshithvasudev/algorithmic-efficiency | ff40676d5da7ca8b9097cf89ee385a67bfdd42c1 | [
"Apache-2.0"
] | null | null | null | spec.py | rakshithvasudev/algorithmic-efficiency | ff40676d5da7ca8b9097cf89ee385a67bfdd42c1 | [
"Apache-2.0"
] | null | null | null | spec.py | rakshithvasudev/algorithmic-efficiency | ff40676d5da7ca8b9097cf89ee385a67bfdd42c1 | [
"Apache-2.0"
] | null | null | null | """MLPerf™ Algorithmic Efficiency API."""
import enum
import time
from typing import Any, Callable, Dict, Iterator, List, Tuple, Union
import abc
class LossType(enum.Enum):
SOFTMAX_CROSS_ENTROPY = 0
SIGMOID_CROSS_ENTROPY = 1
MEAN_SQUARED_ERROR = 2
class ForwardPassMode(enum.Enum):
TRAIN = 0
EVAL = 1
#... | 27.921986 | 84 | 0.711963 |
import enum
import time
from typing import Any, Callable, Dict, Iterator, List, Tuple, Union
import abc
class LossType(enum.Enum):
SOFTMAX_CROSS_ENTROPY = 0
SIGMOID_CROSS_ENTROPY = 1
MEAN_SQUARED_ERROR = 2
class ForwardPassMode(enum.Enum):
TRAIN = 0
EVAL = 1
class ParameterType(enum.Enum):
WEIGHT ... | true | true |
08f9d15fdeb9badb745f4ac0112cb7fcdb0976da | 9,320 | py | Python | scripts/evaluate.py | tuantranf/doctr | 69f9ced542999ef5fa35f3153d7a06661d3c4d3f | [
"Apache-2.0"
] | 2 | 2021-12-17T03:36:56.000Z | 2022-01-31T06:21:55.000Z | evaluate.py | jyotidabass/document_text_recognition | 7bbdf4b1e5f7e9a28a7047dcd13eb2a5501643ef | [
"Apache-2.0"
] | 1 | 2022-02-10T19:50:56.000Z | 2022-02-10T19:50:56.000Z | evaluate.py | jyotidabass/document_text_recognition | 7bbdf4b1e5f7e9a28a7047dcd13eb2a5501643ef | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2021-2022, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
import numpy as np
from tqdm import tqdm
from doctr import datasets... | 45.242718 | 117 | 0.514807 |
import os
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
import numpy as np
from tqdm import tqdm
from doctr import datasets
from doctr.file_utils import is_tf_available
from doctr.models import ocr_predictor
from doctr.models._utils import extract_crops, extract_rcrops
from doctr.utils.metrics import LocalizationConfus... | true | true |
08f9d1754095b58e26e1c99d34ea91482e847e0e | 8,228 | py | Python | galvasr2/yamnet/yamnet/features.py | mlcommons/peoples-speech | 1bfaa7d843e0f664e16bbdbc308f7fa40ac7e10c | [
"Apache-2.0"
] | 62 | 2021-03-07T06:15:48.000Z | 2022-03-24T18:58:57.000Z | src/ertk/preprocessing/audioset/_yamnet/features.py | agkphysics/emotion | 36bb9265f9439b10676fb539d5334cce645e49ef | [
"MIT"
] | 59 | 2021-02-26T21:37:03.000Z | 2022-03-24T16:57:12.000Z | src/ertk/preprocessing/audioset/_yamnet/features.py | agkphysics/emotion | 36bb9265f9439b10676fb539d5334cce645e49ef | [
"MIT"
] | 9 | 2021-02-26T21:34:11.000Z | 2022-02-09T04:00:50.000Z | # Copyright 2019 The TensorFlow Authors All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 42.854167 | 89 | 0.649125 |
import numpy as np
import tensorflow as tf
def waveform_to_log_mel_spectrogram_patches(waveform, params):
with tf.name_scope("log_mel_features"):
window_length_samples = int(
round(params.sample_rate * params.stft_window_seconds)
)
hop_length_samples ... | true | true |
08f9d367732eb324e75db8873fe1d9143f934b5f | 18,198 | py | Python | gehomesdk/clients/websocket_client.py | bendavis/gehome | 017aeca860f231f60bc70fc747067388ad577b18 | [
"MIT"
] | null | null | null | gehomesdk/clients/websocket_client.py | bendavis/gehome | 017aeca860f231f60bc70fc747067388ad577b18 | [
"MIT"
] | null | null | null | gehomesdk/clients/websocket_client.py | bendavis/gehome | 017aeca860f231f60bc70fc747067388ad577b18 | [
"MIT"
] | null | null | null | import asyncio
import logging
import websockets
from typing import Any, Dict, List, Optional, Tuple
from ..erd import ErdCode, ErdCodeType
from ..exception import *
from ..ge_appliance import GeAppliance
from .async_helpers import CancellableAsyncIterator
from .base_client import GeBaseClient
from .const import (
... | 37.83368 | 214 | 0.585559 | import asyncio
import logging
import websockets
from typing import Any, Dict, List, Optional, Tuple
from ..erd import ErdCode, ErdCodeType
from ..exception import *
from ..ge_appliance import GeAppliance
from .async_helpers import CancellableAsyncIterator
from .base_client import GeBaseClient
from .const import (
... | true | true |
08f9d539c18622f53473748be07df88451967026 | 5,926 | py | Python | graylog/models/create_output_request.py | yumimobi/graylog.py | 3118f4a49c91c2cbbd660523b0ab99e56fbfd861 | [
"Apache-2.0"
] | 10 | 2016-09-27T08:13:22.000Z | 2018-09-04T13:15:42.000Z | graylog/models/create_output_request.py | yumimobi/graylog.py | 3118f4a49c91c2cbbd660523b0ab99e56fbfd861 | [
"Apache-2.0"
] | 1 | 2019-08-28T16:16:09.000Z | 2019-08-28T16:16:09.000Z | graylog/models/create_output_request.py | yumimobi/graylog.py | 3118f4a49c91c2cbbd660523b0ab99e56fbfd861 | [
"Apache-2.0"
] | 5 | 2016-11-03T07:45:18.000Z | 2021-08-19T14:21:49.000Z | # coding: utf-8
"""
No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.1.1+01d50e5
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you m... | 25.877729 | 104 | 0.574587 |
from pprint import pformat
from six import iteritems
import re
class CreateOutputRequest(object):
def __init__(self, title=None, type=None, configuration=None, streams=None, content_pack=None):
self.swagger_types = {
'title': 'str',
'type': 'str',
'configuration': 'ob... | true | true |
08f9d58e53b15dbc74f3904143032adb8829ed10 | 3,443 | py | Python | tensornetwork/contractors/opt_einsum_paths/path_calculation_test.py | gazay/TensorNetwork | 1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e | [
"Apache-2.0"
] | 1 | 2019-10-13T03:32:57.000Z | 2019-10-13T03:32:57.000Z | tensornetwork/contractors/opt_einsum_paths/path_calculation_test.py | gazay/TensorNetwork | 1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e | [
"Apache-2.0"
] | null | null | null | tensornetwork/contractors/opt_einsum_paths/path_calculation_test.py | gazay/TensorNetwork | 1564a24d6fef6d6ecd90dc01b55a5aa3f5d71b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The TensorNetwork Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 31.587156 | 77 | 0.671507 | import numpy as np
import opt_einsum
import pytest
import tensornetwork
from tensornetwork.contractors.opt_einsum_paths import utils
def check_path(calculated_path, correct_path):
if not isinstance(calculated_path, list):
return False
if len(calculated_path) != len(correct_path):
return False
ret = Tr... | true | true |
08f9d608d0f9a60dcfaee25f7328431cc20048fe | 17,340 | py | Python | tests/providers/google/cloud/hooks/test_dataproc.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 1 | 2019-05-07T06:46:55.000Z | 2019-05-07T06:46:55.000Z | tests/providers/google/cloud/hooks/test_dataproc.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 7 | 2021-06-28T20:24:56.000Z | 2022-02-26T02:01:36.000Z | tests/providers/google/cloud/hooks/test_dataproc.py | troywinter/airflow | ba66ba0d97941c55d9f00f66329a9d3c7ad673e7 | [
"Apache-2.0"
] | 1 | 2019-06-15T08:38:53.000Z | 2019-06-15T08:38:53.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 37.777778 | 95 | 0.661073 | import unittest
import mock
from google.cloud.dataproc_v1beta2.types import JobStatus
from airflow.exceptions import AirflowException
from airflow.providers.google.cloud.hooks.dataproc import DataprocHook, DataProcJobBuilder
from airflow.version import version
AIRFLOW_VERSION = "v" + version.replace(".", "-").repla... | true | true |
08f9d6286887ce231df006f378a019f46b0ba2fc | 19,253 | py | Python | rpsrunner.py | vmonaco/rpscontest | 1c70182fc97c14f30aa41f08f2371347f0f2f743 | [
"BSD-3-Clause"
] | 3 | 2016-07-24T23:01:43.000Z | 2020-11-08T19:21:09.000Z | rpsrunner.py | vmonaco/rpscontest | 1c70182fc97c14f30aa41f08f2371347f0f2f743 | [
"BSD-3-Clause"
] | 1 | 2020-03-18T07:11:38.000Z | 2020-03-21T20:40:26.000Z | rpsrunner.py | vmonaco/rpscontest | 1c70182fc97c14f30aa41f08f2371347f0f2f743 | [
"BSD-3-Clause"
] | 2 | 2015-09-02T03:44:29.000Z | 2020-03-18T07:07:30.000Z | #!/usr/bin/env python
# Rock-Paper-Scissors runner for http://www.rpscontest.com/
# Copyright (c) 2011 Jonathan Burdge
#
# 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,... | 32.467116 | 79 | 0.591908 |
try:
from multiprocessing import Pool, cpu_count
except:
Pool = None
import getopt
import glob
import os
import random
import sys
import time
import traceback
VERSION = "1.0.1"
MATCHES = 10
POOL_SIZE = 1
if Pool is not None:
try:
POOL_SIZE = cpu_count()
except:
pass
WINDOWS = Fal... | false | true |
08f9d679489628e8a424ef99302fd79b38ae9408 | 1,885 | py | Python | virtual/lib/python3.6/site-packages/dns/rdtypes/IN/AAAA.py | amoskipz/pitch | 477599a56958bc677e22764d7e0cc14d34510e8c | [
"Unlicense",
"MIT"
] | 2 | 2021-07-26T15:04:07.000Z | 2021-07-26T17:23:08.000Z | virtual/lib/python3.6/site-packages/dns/rdtypes/IN/AAAA.py | amoskipz/pitch | 477599a56958bc677e22764d7e0cc14d34510e8c | [
"Unlicense",
"MIT"
] | 30 | 2020-07-31T05:23:33.000Z | 2022-03-25T11:04:00.000Z | virtual/lib/python3.6/site-packages/dns/rdtypes/IN/AAAA.py | amoskipz/pitch | 477599a56958bc677e22764d7e0cc14d34510e8c | [
"Unlicense",
"MIT"
] | 2 | 2021-02-27T09:46:02.000Z | 2021-08-06T03:12:20.000Z | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and ... | 35.566038 | 77 | 0.716711 |
import dns.exception
import dns.ipv6
import dns.rdata
import dns.tokenizer
class AAAA(dns.rdata.Rdata):
__slots__ = ['address']
def __init__(self, rdclass, rdtype, address):
super().__init__(rdclass, rdtype)
dns.ipv6.inet_aton(address)
object.__setattr__(self, 'address', a... | true | true |
08f9d6c8371864b142a55a65b5413af64f32de58 | 16,796 | py | Python | django/db/models/sql/where.py | dekkers/django | 0e51d8eb66121b2558a38c9f4e366df781046873 | [
"BSD-3-Clause"
] | 1 | 2017-02-08T15:13:43.000Z | 2017-02-08T15:13:43.000Z | django/db/models/sql/where.py | dekkers/django | 0e51d8eb66121b2558a38c9f4e366df781046873 | [
"BSD-3-Clause"
] | null | null | null | django/db/models/sql/where.py | dekkers/django | 0e51d8eb66121b2558a38c9f4e366df781046873 | [
"BSD-3-Clause"
] | null | null | null | """
Code to manage the creation and SQL rendering of 'where' constraints.
"""
from __future__ import absolute_import
import datetime
from itertools import repeat
from django.conf import settings
from django.db.models.fields import DateTimeField, Field
from django.db.models.sql.datastructures import EmptyResultSet, E... | 40.278177 | 107 | 0.591808 |
from __future__ import absolute_import
import datetime
from itertools import repeat
from django.conf import settings
from django.db.models.fields import DateTimeField, Field
from django.db.models.sql.datastructures import EmptyResultSet, Empty
from django.db.models.sql.aggregates import Aggregate
from django.utils.i... | true | true |
08f9d74d6127f46913002547d4685c3c2de1dcab | 627 | py | Python | nbs/dl1/blah.py | unigamer/course-v3 | 582db6088277a44c5ea98547fcfd7c27eee25b94 | [
"Apache-2.0"
] | null | null | null | nbs/dl1/blah.py | unigamer/course-v3 | 582db6088277a44c5ea98547fcfd7c27eee25b94 | [
"Apache-2.0"
] | null | null | null | nbs/dl1/blah.py | unigamer/course-v3 | 582db6088277a44c5ea98547fcfd7c27eee25b94 | [
"Apache-2.0"
] | null | null | null | from sys import executable, argv
from subprocess import check_output
from PyQt5.QtWidgets import QFileDialog, QApplication
def gui_fname(directory='./'):
"""Open a file dialog, starting in the given directory, and return
the chosen filename"""
# run this exact file in a separate process, and grab the resul... | 34.833333 | 70 | 0.700159 | from sys import executable, argv
from subprocess import check_output
from PyQt5.QtWidgets import QFileDialog, QApplication
def gui_fname(directory='./'):
file = check_output([executable, __file__, directory])
return file.strip()
if __name__ == "__main__":
directory = argv[1]
app = QApplication([di... | true | true |
08f9d9f151f74c757a4f52422b0689c56fbd10ab | 414 | py | Python | LeetCode/python3/1024.py | ZintrulCre/LeetCode_Archiver | de23e16ead29336b5ee7aa1898a392a5d6463d27 | [
"MIT"
] | 279 | 2019-02-19T16:00:32.000Z | 2022-03-23T12:16:30.000Z | LeetCode/python3/1024.py | ZintrulCre/LeetCode_Archiver | de23e16ead29336b5ee7aa1898a392a5d6463d27 | [
"MIT"
] | 2 | 2019-03-31T08:03:06.000Z | 2021-03-07T04:54:32.000Z | LeetCode/python3/1024.py | ZintrulCre/LeetCode_Crawler | de23e16ead29336b5ee7aa1898a392a5d6463d27 | [
"MIT"
] | 12 | 2019-01-29T11:45:32.000Z | 2019-02-04T16:31:46.000Z | class Solution:
def videoStitching(self, clips: List[List[int]], T: int) -> int:
clips.sort()
res, start, end, i = 0, 0, 0, 0
while end < T:
while i < len(clips) and clips[i][0] <= start:
end = max(end, clips[i][1])
i += 1
if start == e... | 29.571429 | 68 | 0.425121 | class Solution:
def videoStitching(self, clips: List[List[int]], T: int) -> int:
clips.sort()
res, start, end, i = 0, 0, 0, 0
while end < T:
while i < len(clips) and clips[i][0] <= start:
end = max(end, clips[i][1])
i += 1
if start == e... | true | true |
08f9d9fa8cddf75323942b995e0eb374a96f1efe | 326,907 | py | Python | bindings/python/ensmallen_graph/datasets/networkrepository/emailenron.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/emailenron.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/emailenron.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph email-enron.
The graph is automatically retrieved from the NetworkRepository repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021... | 1,520.497674 | 159,629 | 0.669612 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def EmailEnron(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/networkrepository",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
r... | true | true |
08f9da5d1cea893c2dc50d23224e26041f33ff87 | 3,588 | py | Python | runtime/translation/seq2seq/utils.py | NestLakerJasonLIN/pipedream | f50827f2e28cbdbd82a4ea686c0498272b1460d6 | [
"MIT"
] | 273 | 2019-08-31T14:12:11.000Z | 2022-03-05T13:34:25.000Z | runtime/translation/seq2seq/utils.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 67 | 2019-09-19T15:36:59.000Z | 2022-01-13T09:11:54.000Z | runtime/translation/seq2seq/utils.py | albertsh10/pipedream | cad624f79a71f44ba79099f0c38321347b13e5c2 | [
"MIT"
] | 100 | 2019-09-16T20:59:14.000Z | 2022-03-23T12:56:56.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import ctypes
import torch
from seq2seq.train.smoothing import LabelSmoothing
from seq2seq.train.smoothing import CrossEntropyWrapper
def l2_promote():
# Check what's the device limit for current device, should be 64 by default
pValue... | 28.47619 | 90 | 0.617057 |
import ctypes
import torch
from seq2seq.train.smoothing import LabelSmoothing
from seq2seq.train.smoothing import CrossEntropyWrapper
def l2_promote():
pValue = ctypes.cast((ctypes.c_int*1)(), ctypes.POINTER(ctypes.c_int))
result = torch.cuda.cudart().cudaDeviceGetLimit(pValue, ctypes.c_int(0x05))
... | true | true |
08f9dc1b20aa39412e5207196ac16ed9d56d08bf | 161 | py | Python | api/admin.py | sokky/hangups_api | 55d2ecb482b8495b39d6101a9a3b3e41e0168859 | [
"MIT"
] | null | null | null | api/admin.py | sokky/hangups_api | 55d2ecb482b8495b39d6101a9a3b3e41e0168859 | [
"MIT"
] | null | null | null | api/admin.py | sokky/hangups_api | 55d2ecb482b8495b39d6101a9a3b3e41e0168859 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import HangupsApiUser, HangupsApiToken
admin.site.register(HangupsApiUser)
admin.site.register(HangupsApiToken)
| 20.125 | 51 | 0.84472 | from django.contrib import admin
from .models import HangupsApiUser, HangupsApiToken
admin.site.register(HangupsApiUser)
admin.site.register(HangupsApiToken)
| true | true |
08f9dcacece0d378be3274a26b451ddd7db71505 | 3,703 | py | Python | serpantin/dojoforms/models.py | ainomugish/serpantin | 1ae39733d9fb8f5c1c326e2b6ade48351e9956cc | [
"BSD-3-Clause"
] | null | null | null | serpantin/dojoforms/models.py | ainomugish/serpantin | 1ae39733d9fb8f5c1c326e2b6ade48351e9956cc | [
"BSD-3-Clause"
] | null | null | null | serpantin/dojoforms/models.py | ainomugish/serpantin | 1ae39733d9fb8f5c1c326e2b6ade48351e9956cc | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from django.contrib.contenttypes import generic
import fields
from generic import GenericManyToManyField
#from tagging.fields import TagField as _TagField
#from tagging.models import Tag
class ComboField(models.ForeignKey):
def __init__(self, to, to_field=None, **kwargs):
mode... | 37.03 | 100 | 0.675938 | from django.db import models
from django.contrib.contenttypes import generic
import fields
from generic import GenericManyToManyField
class ComboField(models.ForeignKey):
def __init__(self, to, to_field=None, **kwargs):
models.ForeignKey.__init__(self, to, to_field, **kwargs)
def get_internal_type(se... | true | true |
08f9ddfe2017baef08307acb4c471c58912e4ec8 | 2,196 | py | Python | src/books.py | sul-dlss-labs/ai-etd | 26a19663f1dc464deee4c177fe39762931dacf35 | [
"Apache-2.0"
] | 1 | 2020-11-10T13:54:38.000Z | 2020-11-10T13:54:38.000Z | src/books.py | sul-dlss-labs/ai-etd | 26a19663f1dc464deee4c177fe39762931dacf35 | [
"Apache-2.0"
] | 1 | 2020-10-29T21:45:17.000Z | 2020-10-29T22:11:26.000Z | src/books.py | sul-dlss-labs/ai-etd | 26a19663f1dc464deee4c177fe39762931dacf35 | [
"Apache-2.0"
] | null | null | null | __license__ = "Apache 2"
from zipfile import ZipFile
import numpy as np
import pandas as pd
fast_uri_list = []
for row in fast_bio['URI']:
fast_uri_list.append(row)
def process_page(page_text: str, fast_uris) -> list:
record = np.zeros(len(fast_bio))
for uri in fast_uris:
position = fast_uri_lis... | 33.272727 | 103 | 0.583333 | __license__ = "Apache 2"
from zipfile import ZipFile
import numpy as np
import pandas as pd
fast_uri_list = []
for row in fast_bio['URI']:
fast_uri_list.append(row)
def process_page(page_text: str, fast_uris) -> list:
record = np.zeros(len(fast_bio))
for uri in fast_uris:
position = fast_uri_lis... | true | true |
08f9defd207d1254dfbc6f1acf5207519e0b0123 | 23,135 | py | Python | heat/engine/api.py | mail2nsrajesh/heat | 83bd7c261ed29f17b14fbd3746182f3ffe85f26b | [
"Apache-2.0"
] | null | null | null | heat/engine/api.py | mail2nsrajesh/heat | 83bd7c261ed29f17b14fbd3746182f3ffe85f26b | [
"Apache-2.0"
] | null | null | null | heat/engine/api.py | mail2nsrajesh/heat | 83bd7c261ed29f17b14fbd3746182f3ffe85f26b | [
"Apache-2.0"
] | null | null | null | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 36.664025 | 79 | 0.66903 |
import collections
from oslo_log import log as logging
from oslo_utils import timeutils
import six
from heat.common.i18n import _
from heat.common import param_utils
from heat.common import template_format
from heat.common import timeutils as heat_timeutils
from heat.engine import constraints as constr
from heat.rpc... | true | true |
08f9dff5ad7d477da7163a8b13706f0f84d133ad | 1,448 | py | Python | 2015/day_03/solution_p1.py | rvaughan/AdventOfCode2017 | fb9199282c0083cd0b3072c27e63ea83d866efc2 | [
"MIT"
] | null | null | null | 2015/day_03/solution_p1.py | rvaughan/AdventOfCode2017 | fb9199282c0083cd0b3072c27e63ea83d866efc2 | [
"MIT"
] | null | null | null | 2015/day_03/solution_p1.py | rvaughan/AdventOfCode2017 | fb9199282c0083cd0b3072c27e63ea83d866efc2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This code holds the solution for part 1 of day 3 of the Advent of Code for 2015.
"""
import sys
def deliver_presents(data):
x = 0
y = 0
houses = {}
houses["{}:{}".format(x,y)] = 1
for move in data:
if move == '^':
y += 1
elif move == 'v':
... | 23.354839 | 112 | 0.571823 | """
This code holds the solution for part 1 of day 3 of the Advent of Code for 2015.
"""
import sys
def deliver_presents(data):
x = 0
y = 0
houses = {}
houses["{}:{}".format(x,y)] = 1
for move in data:
if move == '^':
y += 1
elif move == 'v':
y -= 1
... | false | true |
08f9e1d0a87b61f2f8c318243634a0b2158c7787 | 12,021 | py | Python | cinder/tests/test_nexenta.py | hopem/cinder | 7df656ff0be9fef34a4e19f7b83a0cae554db1e7 | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_nexenta.py | hopem/cinder | 7df656ff0be9fef34a4e19f7b83a0cae554db1e7 | [
"Apache-2.0"
] | null | null | null | cinder/tests/test_nexenta.py | hopem/cinder | 7df656ff0be9fef34a4e19f7b83a0cae554db1e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Nexenta Systems, 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
#
# ... | 39.413115 | 78 | 0.616005 |
import base64
import urllib2
from oslo.config import cfg
from cinder import test
from cinder.volume.drivers import nexenta
from cinder.volume.drivers.nexenta import jsonrpc
from cinder.volume.drivers.nexenta import volume
CONF = cfg.CONF
class TestNexentaDriver(test.TestCase):
TEST_VOLUME_NAME = 'volume1'
... | true | true |
08f9e1e31bed887dd0714b90fa359456db87fd7a | 962 | py | Python | kubernetes_asyncio/test/test_v1_api_group_list.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_api_group_list.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/test/test_v1_api_group_list.py | aK0nshin/kubernetes_asyncio | aef9edcc1f8671a5b1bba9f4684bde890176b19c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.14.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 24.05 | 124 | 0.724532 |
from __future__ import absolute_import
import unittest
import kubernetes_asyncio.client
from kubernetes_asyncio.client.models.v1_api_group_list import V1APIGroupList from kubernetes_asyncio.client.rest import ApiException
class TestV1APIGroupList(unittest.TestCase):
def setUp(self):
pass
def t... | true | true |
08f9e2452add79f06c3409195e95aa5fa671346d | 115 | py | Python | index.py | o-x-y-g-e-n/Web-Scraping-With-Sentiment-Analysis | 4f0faaefdbdc515165a58fd53942c2902c3e7372 | [
"MIT"
] | 3 | 2020-12-23T14:57:59.000Z | 2021-06-14T07:30:25.000Z | index.py | o-x-y-g-e-n/Web-Scraping-With-Sentiment-Analysis | 4f0faaefdbdc515165a58fd53942c2902c3e7372 | [
"MIT"
] | 2 | 2021-04-06T18:21:56.000Z | 2021-06-02T03:36:15.000Z | index.py | o-x-y-g-e-n/Web-Scraping-With-Sentiment-Analysis | 4f0faaefdbdc515165a58fd53942c2902c3e7372 | [
"MIT"
] | 1 | 2021-06-14T07:30:40.000Z | 2021-06-14T07:30:40.000Z | from flask import *
app = Flask(__name__)
from views import *
if __name__ == '__main__':
app.run(debug=True)
| 12.777778 | 26 | 0.686957 | from flask import *
app = Flask(__name__)
from views import *
if __name__ == '__main__':
app.run(debug=True)
| true | true |
08f9e35e442ebe53fe90a749d32a14c1d9943958 | 7,435 | py | Python | Source/prj/main/PrjRunner.py | fairhopeweb/Projeny | 4c11ab8f3d2c91765bdf50766f39b2df1d208467 | [
"MIT"
] | 752 | 2016-01-09T04:56:10.000Z | 2022-02-13T14:13:53.000Z | Source/prj/main/PrjRunner.py | fairhopeweb/Projeny | 4c11ab8f3d2c91765bdf50766f39b2df1d208467 | [
"MIT"
] | 86 | 2016-01-08T22:48:27.000Z | 2019-10-02T03:15:49.000Z | Source/prj/main/PrjRunner.py | fairhopeweb/Projeny | 4c11ab8f3d2c91765bdf50766f39b2df1d208467 | [
"MIT"
] | 108 | 2016-01-10T20:43:52.000Z | 2021-09-17T22:46:26.000Z |
import sys
import os
import webbrowser
from mtm.util.Assert import *
import mtm.util.MiscUtil as MiscUtil
import mtm.util.PlatformUtil as PlatformUtil
from mtm.util.Platforms import Platforms
from mtm.util.CommonSettings import ConfigFileName
import mtm.ioc.Container as Container
from mtm.ioc.Inject import Inject
... | 39.131579 | 331 | 0.699798 |
import sys
import os
import webbrowser
from mtm.util.Assert import *
import mtm.util.MiscUtil as MiscUtil
import mtm.util.PlatformUtil as PlatformUtil
from mtm.util.Platforms import Platforms
from mtm.util.CommonSettings import ConfigFileName
import mtm.ioc.Container as Container
from mtm.ioc.Inject import Inject
... | true | true |
08f9e4135898ebcb482ee2a99d7f34c8d1d874be | 6,711 | py | Python | src/ebay_rest/api/buy_browse/models/image.py | matecsaj/ebay_rest | dd23236f39e05636eff222f99df1e3699ce47d4a | [
"MIT"
] | 3 | 2021-12-12T04:28:03.000Z | 2022-03-10T03:29:18.000Z | src/ebay_rest/api/buy_browse/models/image.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 33 | 2021-06-16T20:44:36.000Z | 2022-03-30T14:55:06.000Z | src/ebay_rest/api/buy_browse/models/image.py | jdavv/ebay_rest | 20fc88c6aefdae9ab90f9c1330e79abddcd750cd | [
"MIT"
] | 7 | 2021-06-03T09:30:23.000Z | 2022-03-08T19:51:33.000Z | # coding: utf-8
"""
Browse API
<p>The Browse API has the following resources:</p> <ul> <li><b> item_summary: </b> Lets shoppers search for specific items by keyword, GTIN, category, charity, product, or item aspects and refine the results by using filters, such as aspects, compatibility, and fields values.<... | 39.710059 | 2,332 | 0.605722 |
import pprint
import re
import six
class Image(object):
swagger_types = {
'height': 'int',
'image_url': 'str',
'width': 'int'
}
attribute_map = {
'height': 'height',
'image_url': 'imageUrl',
'width': 'width'
}
def __init__(self, height=None, ima... | true | true |
08f9e561c9acc8bca80d3e71c026c22cec332c1f | 2,000 | py | Python | cnocr/fit/fit.py | crazygaman/cnocr | f14847ee7627ccd3cd0261ebfcc723c00dce46c9 | [
"Apache-2.0"
] | 2 | 2021-09-19T10:08:30.000Z | 2022-02-08T11:05:31.000Z | cnocr/fit/fit.py | garin-wang/cnocr | c1e340ac408f7f277428b048dfb4570c0d0c71cc | [
"Apache-2.0"
] | null | null | null | cnocr/fit/fit.py | garin-wang/cnocr | c1e340ac408f7f277428b048dfb4570c0d0c71cc | [
"Apache-2.0"
] | null | null | null | import logging
import os
import mxnet as mx
from ..utils import gen_context
def _load_model(args):
if 'load_epoch' not in args or args.load_epoch is None:
return None, None, None
assert args.prefix is not None
model_prefix = args.prefix
sym, arg_params, aux_params = mx.model.load_checkpoint(
... | 31.746032 | 78 | 0.6735 | import logging
import os
import mxnet as mx
from ..utils import gen_context
def _load_model(args):
if 'load_epoch' not in args or args.load_epoch is None:
return None, None, None
assert args.prefix is not None
model_prefix = args.prefix
sym, arg_params, aux_params = mx.model.load_checkpoint(
... | true | true |
08f9e57f0d86c333a552502c7f5d12191f1f7adf | 401 | py | Python | jax_models/layers/__init__.py | DarshanDeshpande/jax-models | ae5750540f142572ff7f276b927a9cdb5195fd23 | [
"Apache-2.0"
] | 61 | 2022-01-08T19:06:48.000Z | 2022-03-28T07:56:19.000Z | jax_models/layers/__init__.py | DarshanDeshpande/jax-models | ae5750540f142572ff7f276b927a9cdb5195fd23 | [
"Apache-2.0"
] | 1 | 2022-02-27T01:15:57.000Z | 2022-02-28T13:31:50.000Z | jax_models/layers/__init__.py | DarshanDeshpande/jax-models | ae5750540f142572ff7f276b927a9cdb5195fd23 | [
"Apache-2.0"
] | 2 | 2022-01-09T10:01:49.000Z | 2022-02-03T23:19:24.000Z | from .squeeze_and_excite_layer import SqueezeAndExcitation
from .depthwise_separable_conv import DepthwiseConv2D, SeparableDepthwiseConv2D
from .drop import DropPath
from .mlp import TransformerMLP
from .attention import Attention
from .mask import Mask
from .patch_util import ExtractPatches, MergePatches, PatchEmbed, ... | 44.555556 | 83 | 0.875312 | from .squeeze_and_excite_layer import SqueezeAndExcitation
from .depthwise_separable_conv import DepthwiseConv2D, SeparableDepthwiseConv2D
from .drop import DropPath
from .mlp import TransformerMLP
from .attention import Attention
from .mask import Mask
from .patch_util import ExtractPatches, MergePatches, PatchEmbed, ... | true | true |
08f9e63f1f8fca688cedc6b57fcf650dbc023bae | 13,923 | py | Python | log_casp_inh/model_162.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_inh/model_162.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_casp_inh/model_162.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('C6A', ['C8pro'])
Monomer('BaxA', ['BaxM', 'BaxA_1', 'BaxA_2', 'SmacM'])
Monomer('Ligand', ['Receptor'])
Monomer('C6pro', ['C3A'])
Monome... | 85.417178 | 598 | 0.808518 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('C6A', ['C8pro'])
Monomer('BaxA', ['BaxM', 'BaxA_1', 'BaxA_2', 'SmacM'])
Monomer('Ligand', ['Receptor'])
Monomer('C6pro', ['C3A'])
Monomer('ParpU', ['C3A'])
Monomer('BidU',... | true | true |
08f9e73031ae08804aa17f4248265f9578a954d3 | 7,666 | py | Python | notebooks/processing.py | sribaheti/aws-iot-analytics-demo | 113668d019756234548621aaa0814e0e0528bfd8 | [
"MIT"
] | null | null | null | notebooks/processing.py | sribaheti/aws-iot-analytics-demo | 113668d019756234548621aaa0814e0e0528bfd8 | [
"MIT"
] | null | null | null | notebooks/processing.py | sribaheti/aws-iot-analytics-demo | 113668d019756234548621aaa0814e0e0528bfd8 | [
"MIT"
] | null | null | null | from __future__ import print_function
import time
import sys
from io import StringIO
import os
import shutil
import argparse
import csv
import json
import numpy as np
import pandas as pd
import logging
from sklearn.compose import ColumnTransformer
from sklearn.externals import joblib
from sklearn.impute import Simpl... | 32.075314 | 108 | 0.649361 | from __future__ import print_function
import time
import sys
from io import StringIO
import os
import shutil
import argparse
import csv
import json
import numpy as np
import pandas as pd
import logging
from sklearn.compose import ColumnTransformer
from sklearn.externals import joblib
from sklearn.impute import Simpl... | true | true |
08f9e745b6677a8577c49d7ec0530fdd481d0685 | 5,998 | py | Python | h/models/group.py | ssin122/test-h | c10062ae23b690afaac0ab4af7b9a5a5e4b686a9 | [
"MIT"
] | null | null | null | h/models/group.py | ssin122/test-h | c10062ae23b690afaac0ab4af7b9a5a5e4b686a9 | [
"MIT"
] | null | null | null | h/models/group.py | ssin122/test-h | c10062ae23b690afaac0ab4af7b9a5a5e4b686a9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import enum
import sqlalchemy as sa
from pyramid import security
from sqlalchemy.orm import exc
import slugify
from memex import models
from h.db import Base
from h.db import mixins
from h import pubid
GROUP_NAME_MIN_LENGTH = 4
GROUP_NAME_MAX_LENGTH = 25
GROUP_DESCRIPTION_MAX_LENGTH = 250
... | 31.403141 | 79 | 0.632044 |
import enum
import sqlalchemy as sa
from pyramid import security
from sqlalchemy.orm import exc
import slugify
from memex import models
from h.db import Base
from h.db import mixins
from h import pubid
GROUP_NAME_MIN_LENGTH = 4
GROUP_NAME_MAX_LENGTH = 25
GROUP_DESCRIPTION_MAX_LENGTH = 250
class GroupFactory(objec... | true | true |
08f9e88117b96de614113824975b55d0dcf8a0cf | 36,681 | py | Python | research/object_detection/model_lib.py | Javadzb/models | 5fff97264564bf132c20b24dc94b9fdbe6afd56e | [
"Apache-2.0"
] | 1 | 2018-12-26T18:58:00.000Z | 2018-12-26T18:58:00.000Z | research/object_detection/model_lib.py | Javadzb/models | 5fff97264564bf132c20b24dc94b9fdbe6afd56e | [
"Apache-2.0"
] | null | null | null | research/object_detection/model_lib.py | Javadzb/models | 5fff97264564bf132c20b24dc94b9fdbe6afd56e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 41.921143 | 136 | 0.701917 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import functools
import os
import pdb
import tensorflow as tf
from object_detection import eval_util
from object_detection import exporter as exporter_lib
from object_detection import inputs
fro... | true | true |
08f9e9667cd6a7a956b147c6a38248b2ee89abf9 | 9,896 | py | Python | pushservices/wns.py | catalyst/airnotifier | 9b355af2b8bb838b36108b8145034963fb13a124 | [
"BSD-3-Clause"
] | null | null | null | pushservices/wns.py | catalyst/airnotifier | 9b355af2b8bb838b36108b8145034963fb13a124 | [
"BSD-3-Clause"
] | null | null | null | pushservices/wns.py | catalyst/airnotifier | 9b355af2b8bb838b36108b8145034963fb13a124 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2012, Dongsheng Cai
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, t... | 38.807843 | 149 | 0.625808 |
from . import PushService
import requests
from tornado.httpclient import AsyncHTTPClient
import time
import xml.etree.ElementTree as ET
try:
from cStringIO import StringIO
except:
from io import StringIO
import logging
_logger = logging.getLogger(__name__)
try:
register_namespace = ET.register_namespa... | true | true |
08f9e9892233a50058049416051e381d23559460 | 5,286 | py | Python | tornado_restful/handler.py | postelrich/tornado_restful | d1a1f392c319922982ef4e82ff85f22feae084ea | [
"BSD-3-Clause"
] | null | null | null | tornado_restful/handler.py | postelrich/tornado_restful | d1a1f392c319922982ef4e82ff85f22feae084ea | [
"BSD-3-Clause"
] | null | null | null | tornado_restful/handler.py | postelrich/tornado_restful | d1a1f392c319922982ef4e82ff85f22feae084ea | [
"BSD-3-Clause"
] | null | null | null | import tornado
import tornado.web
from .path import RestFunction
from .tree import PathDispatcher
from .utils import api_serialize, run_in_executor
def get(uri, response_type='json'):
def wrapped(f):
return RestFunction(f, uri, 'GET', response_type=response_type)
return wrapped
def post(uri, respon... | 32.62963 | 102 | 0.648695 | import tornado
import tornado.web
from .path import RestFunction
from .tree import PathDispatcher
from .utils import api_serialize, run_in_executor
def get(uri, response_type='json'):
def wrapped(f):
return RestFunction(f, uri, 'GET', response_type=response_type)
return wrapped
def post(uri, respon... | true | true |
08f9e9b6d73c75bfefa1fda8ac3766fec4704393 | 485 | py | Python | lq_pubsub_server/models/message.py | PhotonQuantum/lq-pubsub-hub | e45a579e5606ab27c5d4b09f97fb198a69c3d25f | [
"MIT"
] | null | null | null | lq_pubsub_server/models/message.py | PhotonQuantum/lq-pubsub-hub | e45a579e5606ab27c5d4b09f97fb198a69c3d25f | [
"MIT"
] | null | null | null | lq_pubsub_server/models/message.py | PhotonQuantum/lq-pubsub-hub | e45a579e5606ab27c5d4b09f97fb198a69c3d25f | [
"MIT"
] | null | null | null | import uuid
from datetime import datetime
from pydantic.fields import Field
from pydantic.main import BaseModel
from .types import MessageID, TopicID
class InputMessage(BaseModel):
timestamp: datetime = Field(default_factory=datetime.now)
data: str
attrs: dict
class Config:
json_encoders = ... | 20.208333 | 61 | 0.71134 | import uuid
from datetime import datetime
from pydantic.fields import Field
from pydantic.main import BaseModel
from .types import MessageID, TopicID
class InputMessage(BaseModel):
timestamp: datetime = Field(default_factory=datetime.now)
data: str
attrs: dict
class Config:
json_encoders = ... | true | true |
08f9ea0f6f2776c957778678b85edf311fde6a0b | 2,866 | py | Python | src/utils/model_utils.py | acaglayan/CNN_randRNN | 8b5212f25d772f66d770aaa4389741bf8c25c48c | [
"MIT"
] | 8 | 2020-11-15T13:00:01.000Z | 2022-03-29T17:27:15.000Z | src/utils/model_utils.py | nevrez/CNN_randRNN | d1d78922be88f2ad715246d11e36d9ba9b0b81b2 | [
"MIT"
] | 3 | 2020-06-01T08:28:52.000Z | 2021-11-17T09:53:59.000Z | src/utils/model_utils.py | nevrez/CNN_randRNN | d1d78922be88f2ad715246d11e36d9ba9b0b81b2 | [
"MIT"
] | 5 | 2020-05-12T13:28:16.000Z | 2022-02-10T08:54:35.000Z | import numpy as np
from torchvision import transforms
import depth_transform
from basic_utils import DataTypes
def init_random_weights(num_split, chunk_size, rfs, opt):
if opt == 'reduce_rfs':
num_map = chunk_size
rfs = int(np.sqrt(num_split)) * rfs[0]
rfs = (rfs, rfs)
else:
n... | 27.295238 | 111 | 0.640963 | import numpy as np
from torchvision import transforms
import depth_transform
from basic_utils import DataTypes
def init_random_weights(num_split, chunk_size, rfs, opt):
if opt == 'reduce_rfs':
num_map = chunk_size
rfs = int(np.sqrt(num_split)) * rfs[0]
rfs = (rfs, rfs)
else:
n... | true | true |
08f9ea91b20ba65d42553d41a7bb022ed7b83092 | 2,244 | py | Python | testsuite/test_all.py | dsedivec/pycodestyle | e38b3d30aab29f63ce721be93b93619554dd3ddd | [
"MIT"
] | 1 | 2018-10-18T05:55:20.000Z | 2018-10-18T05:55:20.000Z | testsuite/test_all.py | aejb/pycodestyle | 8053c7c1d5597b062c58c5991231b62e11b435e9 | [
"MIT"
] | null | null | null | testsuite/test_all.py | aejb/pycodestyle | 8053c7c1d5597b062c58c5991231b62e11b435e9 | [
"MIT"
] | 1 | 2018-10-12T06:04:17.000Z | 2018-10-12T06:04:17.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os.path
import sys
import unittest
import pycodestyle
from testsuite.support import init_tests, selftest, ROOT_DIR
# Note: please only use a subset of unittest methods which were present
# in Python 2.5: assert(True|False|Equal|NotEqual|Raises)
class PycodestyleT... | 33 | 74 | 0.675134 | import os.path
import sys
import unittest
import pycodestyle
from testsuite.support import init_tests, selftest, ROOT_DIR
class PycodestyleTestCase(unittest.TestCase):
def setUp(self):
self._style = pycodestyle.StyleGuide(
paths=[os.path.join(ROOT_DIR, 'testsuite')],
select='E,W... | true | true |
08f9ed0eab021ffbc59ca75eba9c7dc5071f2786 | 232 | py | Python | src/posterazorapi/__main__.py | asweigart/posterazorapi | ab5026b3f6b5d965258b7888e76be7f0369ddcdc | [
"MIT"
] | null | null | null | src/posterazorapi/__main__.py | asweigart/posterazorapi | ab5026b3f6b5d965258b7888e76be7f0369ddcdc | [
"MIT"
] | null | null | null | src/posterazorapi/__main__.py | asweigart/posterazorapi | ab5026b3f6b5d965258b7888e76be7f0369ddcdc | [
"MIT"
] | null | null | null | import posterazorapi
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
sys.exit('Please supply an image file to make PDFs from.')
for i in range(1, len(sys.argv)):
posterazorapi.run(sys.argv[i])
| 21.090909 | 66 | 0.642241 | import posterazorapi
import sys
if __name__ == '__main__':
if len(sys.argv) < 2:
sys.exit('Please supply an image file to make PDFs from.')
for i in range(1, len(sys.argv)):
posterazorapi.run(sys.argv[i])
| true | true |
08f9edb5b0855946480474e528bada3639000cb6 | 1,377 | py | Python | mr_scrapper/jobs/iexcloud_company_financials/scrap_iexcloud_company_financials.py | Mario8289/mr_scrapper | 38c3d0a150a7cb3cd3b1806cd0de8e8c70ea83d5 | [
"FTL"
] | null | null | null | mr_scrapper/jobs/iexcloud_company_financials/scrap_iexcloud_company_financials.py | Mario8289/mr_scrapper | 38c3d0a150a7cb3cd3b1806cd0de8e8c70ea83d5 | [
"FTL"
] | null | null | null | mr_scrapper/jobs/iexcloud_company_financials/scrap_iexcloud_company_financials.py | Mario8289/mr_scrapper | 38c3d0a150a7cb3cd3b1806cd0de8e8c70ea83d5 | [
"FTL"
] | null | null | null | from pandas import DataFrame
from ...scrap import Scrap
from typing import AnyStr
import logging
from iexcloud.stock import Stock
class ScrapIEXCloudCompanyFinancials(Scrap):
def __init__(self):
self.logger = logging.getLogger("ScrapIEXCloudReferenceData")
def run(self, dataset: AnyStr, **kwargs) -... | 32.785714 | 113 | 0.655047 | from pandas import DataFrame
from ...scrap import Scrap
from typing import AnyStr
import logging
from iexcloud.stock import Stock
class ScrapIEXCloudCompanyFinancials(Scrap):
def __init__(self):
self.logger = logging.getLogger("ScrapIEXCloudReferenceData")
def run(self, dataset: AnyStr, **kwargs) -... | true | true |
08f9eddfeabc8aa2035cacca7c5382d02e384cef | 25,716 | py | Python | demo/demo_squeeze.py | akdiem/poroelastic | 5361bfcaf7013898ae8a0681eba7e62e79c93b2d | [
"BSD-3-Clause"
] | 1 | 2021-07-19T21:10:13.000Z | 2021-07-19T21:10:13.000Z | demo/demo_squeeze.py | akdiem/poroelastic | 5361bfcaf7013898ae8a0681eba7e62e79c93b2d | [
"BSD-3-Clause"
] | null | null | null | demo/demo_squeeze.py | akdiem/poroelastic | 5361bfcaf7013898ae8a0681eba7e62e79c93b2d | [
"BSD-3-Clause"
] | 5 | 2019-04-03T11:17:47.000Z | 2020-07-29T07:10:54.000Z | __author__ = "Alexandra Diem, Lisa Pankewitz"
__copyright__ = "Copyright 2019, Alexandra Diem"
__license__ = "BSD-3"
__maintainer__ = "Alexandra Diem"
__email__ = "alexandra@simula.no"
""" This poroelastic demo implements a unit square being compressed using the porous
mechanical framework for modelling the interactio... | 46.003578 | 118 | 0.737556 | __author__ = "Alexandra Diem, Lisa Pankewitz"
__copyright__ = "Copyright 2019, Alexandra Diem"
__license__ = "BSD-3"
__maintainer__ = "Alexandra Diem"
__email__ = "alexandra@simula.no"
import sys
import uuid
import poroelastic as poro
import dolfin as df
import numpy as np
# parallel computing.
#
comm = df.mpi_comm_w... | true | true |
08f9ede020933c5da78cb11e2c88e22655682789 | 2,189 | py | Python | t2t_bert/distributed_pair_sentence_classification/export.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 34 | 2018-12-19T01:00:57.000Z | 2021-03-26T09:36:37.000Z | t2t_bert/distributed_pair_sentence_classification/export.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 11 | 2018-12-25T03:37:59.000Z | 2021-08-25T14:43:58.000Z | t2t_bert/distributed_pair_sentence_classification/export.py | yyht/bert | 480c909e0835a455606e829310ff949c9dd23549 | [
"Apache-2.0"
] | 9 | 2018-12-27T08:00:44.000Z | 2020-06-08T03:05:14.000Z | try:
from distributed_single_sentence_classification.model_interface import model_config_parser
from distributed_single_sentence_classification.model_data_interface import data_interface_server
from distributed_single_sentence_classification.model_fn_interface import model_fn_interface
except:
from distributed_sing... | 33.166667 | 98 | 0.76656 | try:
from distributed_single_sentence_classification.model_interface import model_config_parser
from distributed_single_sentence_classification.model_data_interface import data_interface_server
from distributed_single_sentence_classification.model_fn_interface import model_fn_interface
except:
from distributed_sing... | true | true |
08f9f03e8a02c00bae90e3e3db911719e47ed3f1 | 3,022 | py | Python | noncloud/python/maps/test_mapsgeo.py | omarxs2/cloud-nebulous-serverless | b4f6dad9e3b67957a825f3c4f71090af4400cd3a | [
"Apache-2.0"
] | 4 | 2021-12-30T07:21:38.000Z | 2022-02-14T21:18:37.000Z | noncloud/python/maps/test_mapsgeo.py | omarxs2/cloud-nebulous-serverless | b4f6dad9e3b67957a825f3c4f71090af4400cd3a | [
"Apache-2.0"
] | 2 | 2021-12-30T07:23:46.000Z | 2022-01-07T23:23:44.000Z | noncloud/python/maps/test_mapsgeo.py | omarxs2/cloud-nebulous-serverless | b4f6dad9e3b67957a825f3c4f71090af4400cd3a | [
"Apache-2.0"
] | 8 | 2021-12-22T02:01:40.000Z | 2022-03-23T12:19:35.000Z | # 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 agreed to in writing, so... | 29.920792 | 76 | 0.659166 |
from contextlib import contextmanager
from flask import template_rendered
import pytest
from main import ADDRESS, app as flask_app
BAD_ADDR = '1 ave 90000'
MLT_ADDR = 'york'
@pytest.fixture
def app():
yield flask_app
@contextmanager
def captured_templates(app):
recorded = []
def record(sender, temp... | true | true |
08f9f0f4e9f382ef7cef22f925d14b5d8bf32d11 | 2,087 | py | Python | dbuild/cli/main.py | mickare/docker_build_environment | 770bb41097ed8b98eef719a614d78d3229655e8d | [
"MIT"
] | null | null | null | dbuild/cli/main.py | mickare/docker_build_environment | 770bb41097ed8b98eef719a614d78d3229655e8d | [
"MIT"
] | null | null | null | dbuild/cli/main.py | mickare/docker_build_environment | 770bb41097ed8b98eef719a614d78d3229655e8d | [
"MIT"
] | null | null | null | import argparse
import os
import signal
import docker
import errno
import yaml
from dbuild.cli.commands import CommandManager, CleanCommand, RunCommand
from dbuild.config.config import Config
from dbuild.dcontext import DContext
from dbuild.denvironment import BuildHandler
def loadConfig(args):
# Default config... | 25.765432 | 89 | 0.591759 | import argparse
import os
import signal
import docker
import errno
import yaml
from dbuild.cli.commands import CommandManager, CleanCommand, RunCommand
from dbuild.config.config import Config
from dbuild.dcontext import DContext
from dbuild.denvironment import BuildHandler
def loadConfig(args):
config = Con... | true | true |
08f9f1328178575c3bd8072cd427320de98a38fb | 5,411 | py | Python | models/adversarial_model.py | cryptexis/debias | a9e0106dcb8668b95e4654ccb3e7373a70ea37a3 | [
"MIT"
] | null | null | null | models/adversarial_model.py | cryptexis/debias | a9e0106dcb8668b95e4654ccb3e7373a70ea37a3 | [
"MIT"
] | null | null | null | models/adversarial_model.py | cryptexis/debias | a9e0106dcb8668b95e4654ccb3e7373a70ea37a3 | [
"MIT"
] | 1 | 2021-01-26T10:05:19.000Z | 2021-01-26T10:05:19.000Z | import tensorflow as tf
import numpy as np
from utils.data import convert_categorical
from models.base_model import BaseModel
class Discriminator:
def __init__(self, discriminator_model, protected_variable):
self.model = discriminator_model
self.protected_variable = protected_variable
class Fa... | 50.101852 | 122 | 0.667159 | import tensorflow as tf
import numpy as np
from utils.data import convert_categorical
from models.base_model import BaseModel
class Discriminator:
def __init__(self, discriminator_model, protected_variable):
self.model = discriminator_model
self.protected_variable = protected_variable
class Fa... | true | true |
08f9f15fad707dc8405d99b250967f430167d160 | 767 | py | Python | pysatdnn/models.py | neale/PySATDNN | 85ed9f416702dc9bcbaf3e0a2e93af2ad1fdeee9 | [
"MIT"
] | 1 | 2021-10-05T13:14:27.000Z | 2021-10-05T13:14:27.000Z | pysatdnn/models.py | neale/PySATDNN | 85ed9f416702dc9bcbaf3e0a2e93af2ad1fdeee9 | [
"MIT"
] | 1 | 2021-04-30T21:16:59.000Z | 2021-04-30T21:16:59.000Z | pysatdnn/models.py | neale/PySATDNN | 85ed9f416702dc9bcbaf3e0a2e93af2ad1fdeee9 | [
"MIT"
] | null | null | null | #####################################
# models.py
# contains the definitions for the target neural network architectures
#
####################################
import torch
import torch.nn as nn
import torch.nn.functional as F
class OneLayerDNN(nn.Module):
def __init__(self, d_in, d_out):
super(OneLayerDN... | 23.242424 | 70 | 0.577575 | import torch
import torch.nn as nn
import torch.nn.functional as F
class OneLayerDNN(nn.Module):
def __init__(self, d_in, d_out):
super(OneLayerDNN, self).__init__()
self.linear1 = nn.Linear(d_in, 2)
def forward(self, x):
x = self.linear1(x)
return x
class TwoLayerDNN(nn.Mod... | true | true |
08f9f302efc94d68f4dba6ca248106ebad1074c6 | 5,517 | py | Python | actions/delay_new_pack_executions.py | cognifloyd/st2-pack-lifecycle | 9e87c5339be18c6a8b8faad4e1661bbb0e524931 | [
"Apache-2.0"
] | null | null | null | actions/delay_new_pack_executions.py | cognifloyd/st2-pack-lifecycle | 9e87c5339be18c6a8b8faad4e1661bbb0e524931 | [
"Apache-2.0"
] | null | null | null | actions/delay_new_pack_executions.py | cognifloyd/st2-pack-lifecycle | 9e87c5339be18c6a8b8faad4e1661bbb0e524931 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, Tuple, TYPE_CHECKING
if TYPE_CHECKING:
from python_runner.python_action_wrapper import ActionService
from logging import Logger
from st2client.client import Client
from st2client.models.policy import Policy
from st2common.runners.base_action import Action
# Never try to delay these ... | 36.296053 | 86 | 0.602139 | from typing import Dict, Tuple, TYPE_CHECKING
if TYPE_CHECKING:
from python_runner.python_action_wrapper import ActionService
from logging import Logger
from st2client.client import Client
from st2client.models.policy import Policy
from st2common.runners.base_action import Action
NEVER_MANAGE_ACTIONS = [
... | true | true |
08f9f31a9488ec3c968a812170dcb26d215abc3b | 517 | py | Python | examples/Bounce/test/SIM_bounce_me/RUN_model_exchange/input.py | nasa/TrickFMI | e3548fbd6611a0b3abdd6146e5d95cbd617d6cef | [
"NASA-1.3"
] | 17 | 2017-01-13T06:41:13.000Z | 2021-09-26T14:01:31.000Z | examples/Bounce/test/SIM_bounce_me/RUN_model_exchange/input.py | nasa/TrickFMI | e3548fbd6611a0b3abdd6146e5d95cbd617d6cef | [
"NASA-1.3"
] | 1 | 2018-09-18T17:45:27.000Z | 2021-07-17T08:34:15.000Z | examples/Bounce/test/SIM_bounce_me/RUN_model_exchange/input.py | nasa/TrickFMI | e3548fbd6611a0b3abdd6146e5d95cbd617d6cef | [
"NASA-1.3"
] | 16 | 2017-01-09T02:29:26.000Z | 2019-11-12T20:13:35.000Z |
execfile( "Modified_data/data_record.dr" )
ball.fmu_path = 'fmu/trickBounce.fmu'
# Configure the environment.
ball.gravity = 9.81
ball.e = 0.7
ball.floor = 0.0
# Set the values for initial state.
ball.position = 1.0
ball.velocity = 0.0
ball.acceleration = -ball.gravity
ball.mass ... | 21.541667 | 60 | 0.667311 |
execfile( "Modified_data/data_record.dr" )
ball.fmu_path = 'fmu/trickBounce.fmu'
ball.gravity = 9.81
ball.e = 0.7
ball.floor = 0.0
ball.position = 1.0
ball.velocity = 0.0
ball.acceleration = -ball.gravity
ball.mass = 1.0
ball.floor_event.fires = 0
ball.floor_event.error_t... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.