hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7437dfc14756055935e3dfe87773d4f5e15b10b | 2,572 | py | Python | rssfeed.py | SlashScreen/staticbot-public | 31dae9f33fb28fa3fabc3340f5cc944489892afd | [
"0BSD"
] | null | null | null | rssfeed.py | SlashScreen/staticbot-public | 31dae9f33fb28fa3fabc3340f5cc944489892afd | [
"0BSD"
] | null | null | null | rssfeed.py | SlashScreen/staticbot-public | 31dae9f33fb28fa3fabc3340f5cc944489892afd | [
"0BSD"
] | null | null | null | import feedparser
#import webbrowser
from pathlib import Path
import os
#TODO: Subscribe, Unsubscribe, any new(Requires file of last known rss, compare)?
feeds = []
cwd = os.path.realpath(os.path.join(os.getcwd(),os.path.dirname(__file__)))
def findFile(name):
return os.path.join(cwd,name)
#Does windows/linux p... | 25.72 | 81 | 0.585925 | import feedparser
from pathlib import Path
import os
feeds = []
cwd = os.path.realpath(os.path.join(os.getcwd(),os.path.dirname(__file__)))
def findFile(name):
return os.path.join(cwd,name)
def readSubscriptions():
path = Path(findFile("subscriptions.txt"))
links = []
if not path.is_file():... | true | true |
f7437e486c477325faf603bcc9dc96b215906fc7 | 4,247 | py | Python | edward2/tracers.py | acyrl/edward2 | 466da9a9f655b1da1f7d89c6e6512a44d00de090 | [
"Apache-2.0"
] | null | null | null | edward2/tracers.py | acyrl/edward2 | 466da9a9f655b1da1f7d89c6e6512a44d00de090 | [
"Apache-2.0"
] | null | null | null | edward2/tracers.py | acyrl/edward2 | 466da9a9f655b1da1f7d89c6e6512a44d00de090 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Edward2 Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 32.419847 | 80 | 0.706381 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import contextlib
from edward2.trace import trace
from edward2.trace import traceable
@contextlib.contextmanager
def condition(**model_kwargs):
def _condition(f, *args, **... | true | true |
f7437eaf49e9bcef20767999bf688bdec4639edb | 4,590 | py | Python | tests/test_api_consistency.py | ax3l/conda-build | 7bd26e032757f1fa90f8db5822f5378a133a0ae4 | [
"BSD-3-Clause"
] | 1 | 2019-01-15T10:51:38.000Z | 2019-01-15T10:51:38.000Z | tests/test_api_consistency.py | ax3l/conda-build | 7bd26e032757f1fa90f8db5822f5378a133a0ae4 | [
"BSD-3-Clause"
] | null | null | null | tests/test_api_consistency.py | ax3l/conda-build | 7bd26e032757f1fa90f8db5822f5378a133a0ae4 | [
"BSD-3-Clause"
] | null | null | null | # This file makes sure that our API has not changed. Doing so can not be accidental. Whenever it
# happens, we should bump our major build number, because we may have broken someone.
from inspect import getargspec
import sys
from conda_build import api
def test_api_config():
assert hasattr(api, 'Config')
... | 37.016129 | 108 | 0.668845 |
from inspect import getargspec
import sys
from conda_build import api
def test_api_config():
assert hasattr(api, 'Config')
assert hasattr(api, 'get_or_merge_config')
def test_api_get_or_merge_config():
argspec = getargspec(api.get_or_merge_config)
assert argspec.args == ['config', 'variant']
... | true | true |
f743809492dca348118e3d039ec0d17bac6ab655 | 7,334 | py | Python | qutebrowser/themes/base16-qutebrowser/themes/base16-nord.config.py | ebzzry/dotfiles | 0c775392a031c0e24ee7b165f2533a4254eedc78 | [
"CC0-1.0"
] | 30 | 2016-06-17T01:52:37.000Z | 2021-08-20T11:39:30.000Z | qutebrowser/themes/base16-qutebrowser/themes/base16-nord.config.py | ebzzry/dotfiles | 0c775392a031c0e24ee7b165f2533a4254eedc78 | [
"CC0-1.0"
] | null | null | null | qutebrowser/themes/base16-qutebrowser/themes/base16-nord.config.py | ebzzry/dotfiles | 0c775392a031c0e24ee7b165f2533a4254eedc78 | [
"CC0-1.0"
] | 3 | 2019-04-08T13:09:10.000Z | 2019-11-04T12:20:43.000Z | # base16-qutebrowser (https://github.com/theova/base16-qutebrowser)
# Base16 qutebrowser template by theova
# Nord scheme by arcticicestudio
base00 = "#2E3440"
base01 = "#3B4252"
base02 = "#434C5E"
base03 = "#4C566A"
base04 = "#D8DEE9"
base05 = "#E5E9F0"
base06 = "#ECEFF4"
base07 = "#8FBCBB"
base08 = "#88C0D0"
base09 ... | 28.988142 | 71 | 0.770521 |
base00 = "#2E3440"
base01 = "#3B4252"
base02 = "#434C5E"
base03 = "#4C566A"
base04 = "#D8DEE9"
base05 = "#E5E9F0"
base06 = "#ECEFF4"
base07 = "#8FBCBB"
base08 = "#88C0D0"
base09 = "#81A1C1"
base0A = "#5E81AC"
base0B = "#BF616A"
base0C = "#D08770"
base0D = "#EBCB8B"
base0E = "#A3BE8C"
base0F = "#B48EAD"
c.color... | true | true |
f74380ab2c242402ea106dcd6c06dcc95577f612 | 159,283 | py | Python | leo/core/leoApp.py | ar-jan/leo-editor | a907f9159f935fcacbef5a1ffde888593d48310c | [
"MIT"
] | 1 | 2021-02-08T21:22:38.000Z | 2021-02-08T21:22:38.000Z | leo/core/leoApp.py | ar-jan/leo-editor | a907f9159f935fcacbef5a1ffde888593d48310c | [
"MIT"
] | null | null | null | leo/core/leoApp.py | ar-jan/leo-editor | a907f9159f935fcacbef5a1ffde888593d48310c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#@+leo-ver=5-thin
#@+node:ekr.20031218072017.2608: * @file leoApp.py
#@@first
#@+<< imports >>
#@+node:ekr.20120219194520.10463: ** << imports >> (leoApp)
import importlib
import io
import optparse
import os
import sqlite3
import subprocess
import string
import sys
import time
import traceback
f... | 41.960748 | 115 | 0.52779 |
import importlib
import io
import optparse
import os
import sqlite3
import subprocess
import string
import sys
import time
import traceback
from typing import Any, Dict
import zipfile
import platform
from leo.core import leoGlobals as g
from leo.core import leoExternalFiles
StringIO = io.StringIO
def cmd(name)... | true | true |
f74380e29bf55a404df74474c65f11da2de000b6 | 9,392 | py | Python | rllib/contrib/sumo/connector.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 22 | 2018-05-08T05:52:34.000Z | 2020-04-01T10:09:55.000Z | rllib/contrib/sumo/connector.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 73 | 2021-09-25T07:11:39.000Z | 2022-03-26T07:10:59.000Z | rllib/contrib/sumo/connector.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 10 | 2018-04-27T10:50:59.000Z | 2020-02-24T02:41:43.000Z | """ RLLIB SUMO Utils - SUMO Connector
Author: Lara CODECA lara.codeca@gmail.com
See:
https://github.com/lcodeca/rllibsumoutils
https://github.com/lcodeca/rllibsumodocker
for further details.
"""
import logging
import os
import sys
# Attach $SUMO_HOME/tools to the path to import SUMO libr... | 35.847328 | 84 | 0.566014 |
import logging
import os
import sys
if "SUMO_HOME" in os.environ:
sys.path.append(os.path.join(os.environ["SUMO_HOME"], "tools"))
else:
raise Exception("Please declare environment variable 'SUMO_HOME'")
| true | true |
f7438103bb0339877287f9aa5227dfc478e130c3 | 1,306 | py | Python | tests/test_npz.py | zommiommy/cache_decorator | e7d71dd48890247838612533481d0b5a808c03ec | [
"MIT"
] | 17 | 2020-03-26T21:50:24.000Z | 2022-03-22T19:10:07.000Z | tests/test_npz.py | zommiommy/cache_decorator | e7d71dd48890247838612533481d0b5a808c03ec | [
"MIT"
] | 9 | 2020-08-11T21:01:56.000Z | 2021-04-26T06:27:56.000Z | tests/test_npz.py | zommiommy/cache_decorator | e7d71dd48890247838612533481d0b5a808c03ec | [
"MIT"
] | 1 | 2021-06-18T14:25:05.000Z | 2021-06-18T14:25:05.000Z | import numpy as np
from time import sleep
from shutil import rmtree
from cache_decorator import Cache
from .utils import standard_test_arrays
@Cache(
cache_path="{cache_dir}/{_hash}.npz",
cache_dir="./test_cache",
backup=False,
)
def cached_function_single(a):
sleep(2)
return np.array([1, 2, 3])
@... | 22.517241 | 61 | 0.675345 | import numpy as np
from time import sleep
from shutil import rmtree
from cache_decorator import Cache
from .utils import standard_test_arrays
@Cache(
cache_path="{cache_dir}/{_hash}.npz",
cache_dir="./test_cache",
backup=False,
)
def cached_function_single(a):
sleep(2)
return np.array([1, 2, 3])
@... | true | true |
f743817a5dfa1f7249f286fdba196891333bf956 | 1,221 | py | Python | src/address_gen.py | moeye/executecoin | af86c812a99b09c31ad2b35803b8ae9b25831208 | [
"MIT"
] | 1 | 2019-04-08T01:45:23.000Z | 2019-04-08T01:45:23.000Z | src/address_gen.py | moeye/executecoin | af86c812a99b09c31ad2b35803b8ae9b25831208 | [
"MIT"
] | null | null | null | src/address_gen.py | moeye/executecoin | af86c812a99b09c31ad2b35803b8ae9b25831208 | [
"MIT"
] | 1 | 2019-04-15T03:48:50.000Z | 2019-04-15T03:48:50.000Z | # pip install base58 / ecdsa
# tested in python 3.6.5
import os, binascii, hashlib, base58, ecdsa
def ripemd160(x):
d = hashlib.new('ripemd160')
d.update(x)
return d
for n in range(1): # number of key pairs to generate`
# generate private key, uncompressed bitcoin WIF starts with "5"
priv_key ... | 39.387097 | 87 | 0.693694 |
import os, binascii, hashlib, base58, ecdsa
def ripemd160(x):
d = hashlib.new('ripemd160')
d.update(x)
return d
for n in range(1):
priv_key = os.urandom(32)
fullkey = 'a1' + binascii.hexlify(priv_key).decode()
sha256a = hashlib.sha256(binascii.unhexlify(fullkey)).hexdigest()
sh... | true | true |
f74381c37d1e7ee3945b8d27baf1e7846bd151c0 | 1,291 | py | Python | dice_loss.py | vios-s/RA_FA_Cardiac | 79571cd6542ffda7477878ea98d93b53389090d8 | [
"MIT"
] | 28 | 2021-06-28T10:37:41.000Z | 2022-03-24T02:14:42.000Z | metrics/dice_loss.py | vios-s/DGNet | 8af4b82b62b53e29e96084113a5d379774c11b12 | [
"MIT"
] | 6 | 2021-07-25T11:06:39.000Z | 2021-10-20T18:32:33.000Z | metrics/dice_loss.py | vios-s/DGNet | 8af4b82b62b53e29e96084113a5d379774c11b12 | [
"MIT"
] | 5 | 2021-07-05T13:18:53.000Z | 2021-09-30T14:02:47.000Z | import torch
from torch.autograd import Function
class DiceCoeff(Function):
"""Dice coeff for individual examples"""
def forward(self, input, target):
self.save_for_backward(input, target)
eps = 0.0001
self.inter = torch.dot(input.view(-1), target.view(-1))
self.uni... | 30.023256 | 80 | 0.579396 | import torch
from torch.autograd import Function
class DiceCoeff(Function):
def forward(self, input, target):
self.save_for_backward(input, target)
eps = 0.0001
self.inter = torch.dot(input.view(-1), target.view(-1))
self.union = torch.sum(input) + torch.sum(target) + ep... | true | true |
f74383e1555abeb0405dbe63d87556b5e9c22a7b | 1,337 | py | Python | objectives/results/mag_pwr_all.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 7 | 2022-01-15T02:53:53.000Z | 2022-02-17T00:51:32.000Z | objectives/results/mag_pwr_all.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 8 | 2022-01-16T02:45:24.000Z | 2022-03-21T02:08:27.000Z | objectives/results/mag_pwr_all.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 5 | 2022-01-15T02:53:38.000Z | 2022-01-19T17:42:10.000Z | from objectives.results._objective_result import *
from objectives.results._add_sub_stat import add_stat_all, sub_stat_all
MAG_PWR_ADDRESS = 0x161d
add_mag_pwr = add_stat_all(MAG_PWR_ADDRESS, "mag_pwr")
sub_mag_pwr = sub_stat_all(MAG_PWR_ADDRESS, "mag_pwr")
class Field(field_result.Result):
def src(self, count):
... | 32.609756 | 73 | 0.595363 | from objectives.results._objective_result import *
from objectives.results._add_sub_stat import add_stat_all, sub_stat_all
MAG_PWR_ADDRESS = 0x161d
add_mag_pwr = add_stat_all(MAG_PWR_ADDRESS, "mag_pwr")
sub_mag_pwr = sub_stat_all(MAG_PWR_ADDRESS, "mag_pwr")
class Field(field_result.Result):
def src(self, count):
... | true | true |
f7438465aded7bfa8c83e03557641a845139ca5b | 403 | py | Python | tasks/leaptask/PythonL31V1/peacebase.py | XRDX/pyleap | 2d39ad327b5fc8827657c8554cdf7088905261e4 | [
"BSD-2-Clause"
] | 6 | 2018-06-12T13:13:27.000Z | 2022-03-17T13:52:42.000Z | tasks/leaptask/PythonL31V1/peacebase.py | XRDX/pyleap | 2d39ad327b5fc8827657c8554cdf7088905261e4 | [
"BSD-2-Clause"
] | null | null | null | tasks/leaptask/PythonL31V1/peacebase.py | XRDX/pyleap | 2d39ad327b5fc8827657c8554cdf7088905261e4 | [
"BSD-2-Clause"
] | 7 | 2018-06-13T03:12:23.000Z | 2021-11-16T09:13:44.000Z | from turtle import *
peacecolors = ("blue","black", "red3", "orange", "yellow", "seagreen4", "orchid4")
reset()
Screen()
up()
shape("turtle")
resizemode("user")
shapesize(8, 8)
goto(-320, -195)
width(70)
for pcolor in peacecolors:
color(pcolor)
down()
forward(640)
up()
backward(640)
left(90)
... | 14.392857 | 82 | 0.622829 | from turtle import *
peacecolors = ("blue","black", "red3", "orange", "yellow", "seagreen4", "orchid4")
reset()
Screen()
up()
shape("turtle")
resizemode("user")
shapesize(8, 8)
goto(-320, -195)
width(70)
for pcolor in peacecolors:
color(pcolor)
down()
forward(640)
up()
backward(640)
left(90)
... | true | true |
f74384fd0a678678c1ac0d7bf71ad024d8a92f1c | 17,960 | py | Python | openff/recharge/esp/qcarchive.py | openforcefield/openff-recharge | 0ea3ef986e33c3ecf05924e64fb2e1872913b093 | [
"MIT"
] | 7 | 2020-07-20T02:56:48.000Z | 2022-03-22T18:09:00.000Z | openff/recharge/esp/qcarchive.py | openforcefield/openff-recharge | 0ea3ef986e33c3ecf05924e64fb2e1872913b093 | [
"MIT"
] | 94 | 2020-07-07T23:59:40.000Z | 2022-03-31T09:03:22.000Z | openff/recharge/esp/qcarchive.py | openforcefield/openff-recharge | 0ea3ef986e33c3ecf05924e64fb2e1872913b093 | [
"MIT"
] | null | null | null | import json
import logging
import re
from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Tuple
import numpy
from openff.utilities import requires_package
from pydantic import ValidationError
from openff.recharge.esp import ESPSettings, PCMSettings
from openff.recharge.esp.storage import MoleculeESPRecor... | 33.632959 | 88 | 0.669488 | import json
import logging
import re
from typing import TYPE_CHECKING, Dict, Iterable, List, Optional, Tuple
import numpy
from openff.utilities import requires_package
from pydantic import ValidationError
from openff.recharge.esp import ESPSettings, PCMSettings
from openff.recharge.esp.storage import MoleculeESPRecor... | true | true |
f74385ba733c4af94fe1e15ae272006266a44c79 | 1,166 | py | Python | devproject/core/api/exceptions.py | francisbrito/take-home-assignment | 0eafede75666aa74f9e4bcf31565569d227278cd | [
"MIT"
] | null | null | null | devproject/core/api/exceptions.py | francisbrito/take-home-assignment | 0eafede75666aa74f9e4bcf31565569d227278cd | [
"MIT"
] | null | null | null | devproject/core/api/exceptions.py | francisbrito/take-home-assignment | 0eafede75666aa74f9e4bcf31565569d227278cd | [
"MIT"
] | null | null | null | from rest_framework import exceptions as rest_exceptions
from rest_framework.exceptions import ValidationError
from devproject.core import models
class APIErrorsMixin:
"""
Mixin that transforms Django and Python exceptions into rest_framework ones.
without the mixin, they return 500 status code which is ... | 35.333333 | 99 | 0.747856 | from rest_framework import exceptions as rest_exceptions
from rest_framework.exceptions import ValidationError
from devproject.core import models
class APIErrorsMixin:
expected_exceptions = {
ValueError: rest_exceptions.ValidationError,
ValidationError: rest_exceptions.ValidationError,
P... | true | true |
f74385f66600ae29cd0ea90bb083c369fb9aa2cc | 29,451 | py | Python | tests/python/frontend/caffe/test_forward.py | Xuyuanjia2014/tvm | 892f8305e77ad506660b851f9ce4c81be0f95d9d | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2,084 | 2020-11-25T02:31:53.000Z | 2022-03-31T11:33:47.000Z | tests/python/frontend/caffe/test_forward.py | Xuyuanjia2014/tvm | 892f8305e77ad506660b851f9ce4c81be0f95d9d | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | tests/python/frontend/caffe/test_forward.py | Xuyuanjia2014/tvm | 892f8305e77ad506660b851f9ce4c81be0f95d9d | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 977 | 2020-11-25T00:54:52.000Z | 2022-03-31T12:47:08.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 u... | 29.217262 | 99 | 0.582391 |
import os
os.environ["GLOG_minloglevel"] = "2"
import sys
import logging
logging.basicConfig(level=logging.ERROR)
import numpy as np
from google.protobuf import text_format
import caffe
from caffe import layers as L, params as P
from caffe.proto import caffe_pb2 as pb
import tvm
from tvm import rel... | true | true |
f7438641084de67fb7c0ec068d1cf90937939487 | 837 | py | Python | gammapy/data/tests/test_filters.py | qpiel/gammapy | cfb976909e63f4d5d578e1495245c0baad69482b | [
"BSD-3-Clause"
] | null | null | null | gammapy/data/tests/test_filters.py | qpiel/gammapy | cfb976909e63f4d5d578e1495245c0baad69482b | [
"BSD-3-Clause"
] | 1 | 2020-10-29T19:55:46.000Z | 2020-10-29T19:55:46.000Z | gammapy/data/tests/test_filters.py | qpiel/gammapy | cfb976909e63f4d5d578e1495245c0baad69482b | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function, unicode_literals
from ...data import DataStore, ObservationFilter, EventListBase
from ...utils.testing import requires_data
def test_event_filter_types():
for method_str in Observation... | 32.192308 | 82 | 0.76822 |
from __future__ import absolute_import, division, print_function, unicode_literals
from ...data import DataStore, ObservationFilter, EventListBase
from ...utils.testing import requires_data
def test_event_filter_types():
for method_str in ObservationFilter.EVENT_FILTER_TYPES.values():
assert hasattr(Even... | true | true |
f74388dc0dbcfd8bb8269fb5bdae9770b14e7a4a | 1,064 | py | Python | daemon/core/misc/xmlsession.py | cudadog/coreemu | a00ba92ac32ed4b1a48651dfbd5b08f5925234d8 | [
"BSD-2-Clause"
] | 1 | 2018-07-17T05:07:14.000Z | 2018-07-17T05:07:14.000Z | daemon/core/misc/xmlsession.py | abn/coreemu | a00ba92ac32ed4b1a48651dfbd5b08f5925234d8 | [
"BSD-2-Clause"
] | null | null | null | daemon/core/misc/xmlsession.py | abn/coreemu | a00ba92ac32ed4b1a48651dfbd5b08f5925234d8 | [
"BSD-2-Clause"
] | 1 | 2018-09-02T09:37:14.000Z | 2018-09-02T09:37:14.000Z | #
# CORE
# Copyright (c)2011-2014 the Boeing Company.
# See the LICENSE file included in this distribution.
#
# author: Jeff Ahrenholz <jeffrey.m.ahrenholz@boeing.com>
#
'''
Helpers for loading and saving XML files. savesessionxml(session, filename) is
the main public interface here.
'''
import os.path
from core.netn... | 30.4 | 78 | 0.727444 |
import os.path
from core.netns import nodes
from xmlparser import core_document_parser
from xmlwriter import core_document_writer
def opensessionxml(session, filename, start=False, nodecls=nodes.CoreNode):
options = {'start': start, 'nodecls': nodecls}
doc = core_document_parser(session, filename, opt... | true | true |
f743894fe7d15af4e443853690b53aca61e697f6 | 19,019 | py | Python | mmtbx/ions/__init__.py | jbeilstenedmands/cctbx_project | c228fb15ab10377f664c39553d866281358195aa | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/ions/__init__.py | jbeilstenedmands/cctbx_project | c228fb15ab10377f664c39553d866281358195aa | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/ions/__init__.py | jbeilstenedmands/cctbx_project | c228fb15ab10377f664c39553d866281358195aa | [
"BSD-3-Clause-LBNL"
] | null | null | null | # -*- coding: utf-8; py-indent-offset: 2 -*-
"""
This package is used to model elemental ions in crystal structures. It handles
both identification and building of ions, but relies on the solvent module to
flag candidate sites for screening.
Notes
-----
.. [1] Echols, N. et al. Automated identification of elemental io... | 32.791379 | 80 | 0.632631 |
from __future__ import division
import iotbx.cif
from libtbx import group_args, Auto, slots_getstate_setstate
from libtbx.utils import Sorry
from libtbx import group_args
from math import exp
import time
import os
import sys
DEFAULT_IONS = ["MG", "CA", "ZN", "CL"]
HALIDES = ["F", "CL", "BR", "IOD"]
TRANSITION_METALS... | true | true |
f74389aa7d5a6759084a6b61da4cb76e599e6d09 | 1,836 | py | Python | typetest/analyse/typing_speed_per_char.py | MasterMedo/typetest | 7d573c6bbf0d07ffd3b2fb4a8ee9ce783df2ac26 | [
"MIT"
] | 15 | 2020-08-05T16:55:15.000Z | 2022-03-24T02:47:16.000Z | typetest/analyse/typing_speed_per_char.py | MasterMedo/typetest | 7d573c6bbf0d07ffd3b2fb4a8ee9ce783df2ac26 | [
"MIT"
] | 23 | 2019-08-21T08:32:16.000Z | 2022-03-12T01:02:55.000Z | typetest/analyse/typing_speed_per_char.py | MasterMedo/typetest | 7d573c6bbf0d07ffd3b2fb4a8ee9ce783df2ac26 | [
"MIT"
] | 7 | 2019-08-20T17:49:17.000Z | 2021-10-30T21:19:14.000Z | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from io import StringIO
from collections import deque
from typetest.utils import validate_input_file_path
@validate_input_file_path
def plot(input_file, size=10000, filter_func=lambda c: True):
"""Reads last `size` lines of `input_file` and ... | 30.098361 | 77 | 0.635076 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from io import StringIO
from collections import deque
from typetest.utils import validate_input_file_path
@validate_input_file_path
def plot(input_file, size=10000, filter_func=lambda c: True):
with open(input_file) as f:
q = deque(f... | true | true |
f74389ccbbc325290b4a84805ab6e223a8d96915 | 575 | py | Python | medica_api/core/permissions.py | aseem-hegshetye/Django_Rest_Api | 663693b4003d012029fc3365f01b171824229344 | [
"MIT"
] | null | null | null | medica_api/core/permissions.py | aseem-hegshetye/Django_Rest_Api | 663693b4003d012029fc3365f01b171824229344 | [
"MIT"
] | 15 | 2020-06-06T00:44:36.000Z | 2022-03-12T00:18:42.000Z | medica_api/core/permissions.py | aseem-hegshetye/Django_Rest_Api | 663693b4003d012029fc3365f01b171824229344 | [
"MIT"
] | null | null | null | from rest_framework import permissions
class CustomUserPermission(permissions.BasePermission):
"""
user can see or update only their own profile
"""
def has_object_permission(self, request, view, obj):
""" we have already disabled List method. so get method here will come with id"""
... | 33.823529 | 89 | 0.633043 | from rest_framework import permissions
class CustomUserPermission(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
print(f'request.method ={request.method }')
print(f'request.user.id = {request.user.id}, obj.id={obj.id}')
if request.method in ['PUT', 'PATC... | true | true |
f7438a206b62d385494520c01fb957399a1688b6 | 2,281 | py | Python | setup.py | MarkReedZ/mrhttp | ddf56a6a35b481739b630895ea2bd7b0742ccf88 | [
"MIT"
] | 6 | 2019-03-30T03:49:30.000Z | 2022-01-03T08:17:23.000Z | setup.py | MarkReedZ/mrhttp | ddf56a6a35b481739b630895ea2bd7b0742ccf88 | [
"MIT"
] | 17 | 2018-05-29T03:40:50.000Z | 2019-02-18T19:41:26.000Z | setup.py | MarkReedZ/mrhttp | ddf56a6a35b481739b630895ea2bd7b0742ccf88 | [
"MIT"
] | 1 | 2018-11-18T20:04:42.000Z | 2018-11-18T20:04:42.000Z |
from setuptools import setup, Extension, find_packages
m1 = Extension(
'mrhttp.internals',
sources = [
'./src/mrhttp/internals/module.c',
'./src/mrhttp/internals/utils.c',
'./src/mrhttp/internals/app.c',
'./src/mrhttp/internals/protocol.c',
'./src/mrhttp/internals/mrqprotocol.c... | 34.044776 | 166 | 0.625603 |
from setuptools import setup, Extension, find_packages
m1 = Extension(
'mrhttp.internals',
sources = [
'./src/mrhttp/internals/module.c',
'./src/mrhttp/internals/utils.c',
'./src/mrhttp/internals/app.c',
'./src/mrhttp/internals/protocol.c',
'./src/mrhttp/internals/mrqprotocol.c... | true | true |
f7438a2d770657a01b1e28b3cc474ccfcd815200 | 639 | py | Python | manage.py | ArRosid/django-fundamental | 62d6d474bad6d7956c8b64d0a610daaefd36f561 | [
"MIT"
] | null | null | null | manage.py | ArRosid/django-fundamental | 62d6d474bad6d7956c8b64d0a610daaefd36f561 | [
"MIT"
] | null | null | null | manage.py | ArRosid/django-fundamental | 62d6d474bad6d7956c8b64d0a610daaefd36f561 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_fundamentals.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
... | 29.045455 | 83 | 0.688576 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'django_fundamentals.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed... | true | true |
f7438a611c67be6aa18aec8737f40c3f08644db4 | 8,479 | py | Python | setup.py | tmistelbauer/poets4SATIDA | 50af86a6cda6414831a73bbedcdd075a49b58f4a | [
"BSD-3-Clause"
] | 1 | 2015-10-13T07:09:56.000Z | 2015-10-13T07:09:56.000Z | setup.py | tmistelbauer/poets4SATIDA | 50af86a6cda6414831a73bbedcdd075a49b58f4a | [
"BSD-3-Clause"
] | null | null | null | setup.py | tmistelbauer/poets4SATIDA | 50af86a6cda6414831a73bbedcdd075a49b58f4a | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for poets.
This file was generated with PyScaffold 1.3, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
"""
import os
import sys
import inspect
from distutils.cmd import... | 36.547414 | 79 | 0.549239 |
import os
import sys
import inspect
from distutils.cmd import Command
import versioneer
import setuptools
from setuptools.command.test import test as TestCommand
from setuptools import setup
__location__ = os.path.join(os.getcwd(), os.path.dirname(
inspect.getfile(inspect.currentframe())))
MAIN_PACKAGE = "po... | true | true |
f7438a92d65a1f840172e9022c808391860b26e3 | 625 | py | Python | app/manage.py | LukaszMalucha/django-test | 5a6478f352667e6b4119e2750a73d2caa40f8f3d | [
"MIT"
] | null | null | null | app/manage.py | LukaszMalucha/django-test | 5a6478f352667e6b4119e2750a73d2caa40f8f3d | [
"MIT"
] | null | null | null | app/manage.py | LukaszMalucha/django-test | 5a6478f352667e6b4119e2750a73d2caa40f8f3d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'azure.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportEr... | 28.409091 | 73 | 0.6816 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'azure.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f7438a9c6b90df2c013da224693b9befad7f67de | 24,231 | py | Python | tests/utility_functions.py | benjeffery/tsdate | 93c3dabdeb857a351bf994fc56bf5b8d18bb830d | [
"MIT"
] | null | null | null | tests/utility_functions.py | benjeffery/tsdate | 93c3dabdeb857a351bf994fc56bf5b8d18bb830d | [
"MIT"
] | null | null | null | tests/utility_functions.py | benjeffery/tsdate | 93c3dabdeb857a351bf994fc56bf5b8d18bb830d | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (C) 2020 University of Oxford
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify... | 27.948097 | 88 | 0.41286 |
import msprime
import numpy as np
import tskit
import io
def add_grand_mrca(ts):
grand_mrca = ts.max_root_time + 1
tables = ts.dump_tables()
new_node_number = tables.nodes.add_row(time=grand_mrca)
for tree in ts.trees():
tables.edges.add_row(
tree.interval[0],... | true | true |
f7438bc9e83c38133b675cf30d435000d720e895 | 7,906 | py | Python | tests/sparkml/test_decision_tree_classifier.py | xjarvik/onnxmltools | e4fbdc09814ceedc7655d85b6c4203ca21d8433a | [
"Apache-2.0"
] | 1 | 2022-01-28T04:59:37.000Z | 2022-01-28T04:59:37.000Z | tests/sparkml/test_decision_tree_classifier.py | xjarvik/onnxmltools | e4fbdc09814ceedc7655d85b6c4203ca21d8433a | [
"Apache-2.0"
] | null | null | null | tests/sparkml/test_decision_tree_classifier.py | xjarvik/onnxmltools | e4fbdc09814ceedc7655d85b6c4203ca21d8433a | [
"Apache-2.0"
] | 1 | 2021-07-05T23:51:56.000Z | 2021-07-05T23:51:56.000Z | # SPDX-License-Identifier: Apache-2.0
import sys
import inspect
import unittest
from distutils.version import StrictVersion
import onnx
import pandas
import numpy
from pyspark.ml import Pipeline
from pyspark.ml.classification import DecisionTreeClassifier
from pyspark.ml.linalg import VectorUDT, SparseVector, Vectors... | 54.524138 | 130 | 0.664938 |
import sys
import inspect
import unittest
from distutils.version import StrictVersion
import onnx
import pandas
import numpy
from pyspark.ml import Pipeline
from pyspark.ml.classification import DecisionTreeClassifier
from pyspark.ml.linalg import VectorUDT, SparseVector, Vectors
from onnxmltools import convert_spa... | true | true |
f7438c335b958b208fd29db57949db26650775f6 | 3,863 | py | Python | franka_interface/src/franka_interface/robot_enable.py | StanfordVL/franka_ros_interface | 48067aecfff479572f375d6351c069b47ddc2be3 | [
"Apache-2.0"
] | 1 | 2020-11-12T11:47:39.000Z | 2020-11-12T11:47:39.000Z | franka_interface/src/franka_interface/robot_enable.py | StanfordVL/franka_ros_interface | 48067aecfff479572f375d6351c069b47ddc2be3 | [
"Apache-2.0"
] | null | null | null | franka_interface/src/franka_interface/robot_enable.py | StanfordVL/franka_ros_interface | 48067aecfff479572f375d6351c069b47ddc2be3 | [
"Apache-2.0"
] | 1 | 2020-07-22T03:22:38.000Z | 2020-07-22T03:22:38.000Z | # /***************************************************************************
#
# @package: franka_interface
# @metapackage: franka_ros_interface
# @author: Saif Sidhik <sxs1412@bham.ac.uk>
#
# **************************************************************************/
# /*****************************************... | 30.179688 | 112 | 0.560963 |
import rospy
from threading import Lock
from franka_control.msg import ErrorRecoveryActionGoal
from franka_core_msgs.msg import RobotState
import franka_dataflow
from robot_params import RobotParams
class RobotEnable(object):
param_lock = Lock()
def __init__(self, robot_params ... | true | true |
f7438c41cce40caaed52fce8c251fb6e6e48e8d4 | 2,353 | py | Python | examples/02_nav_maze_static/main.py | miyosuda/rodent | 3d60a234eecd5e2476b186365eb121f0f3655c2e | [
"Apache-2.0"
] | 11 | 2017-09-14T00:52:35.000Z | 2018-07-16T12:21:48.000Z | examples/02_nav_maze_static/main.py | miyosuda/rodent | 3d60a234eecd5e2476b186365eb121f0f3655c2e | [
"Apache-2.0"
] | null | null | null | examples/02_nav_maze_static/main.py | miyosuda/rodent | 3d60a234eecd5e2476b186365eb121f0f3655c2e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import pygame, sys
from pygame.locals import *
from nav_maze_static_environment import NavMazeStaticEnvironment
BLACK = (0, 0, 0)
class RandomAgent(object):
def __init__(self, action_num):
self.action_num = action_num
def choose_action(self, state):
... | 23.53 | 73 | 0.570761 |
import numpy as np
import pygame, sys
from pygame.locals import *
from nav_maze_static_environment import NavMazeStaticEnvironment
BLACK = (0, 0, 0)
class RandomAgent(object):
def __init__(self, action_num):
self.action_num = action_num
def choose_action(self, state):
return np.random.rand... | true | true |
f7438c66fa8bc0334aa9c4a0bfd3dca8ce4ee4ec | 1,396 | py | Python | tests/test_visitors/test_ast/test_keywords/test_generator_keywords/test_yield_from_type.py | n1kolasM/wemake-python-styleguide | f39e87897de89bea1c49d410beb5b1cbaf930807 | [
"MIT"
] | 1 | 2020-02-21T18:58:44.000Z | 2020-02-21T18:58:44.000Z | tests/test_visitors/test_ast/test_keywords/test_generator_keywords/test_yield_from_type.py | n1kolasM/wemake-python-styleguide | f39e87897de89bea1c49d410beb5b1cbaf930807 | [
"MIT"
] | 15 | 2020-02-22T11:09:46.000Z | 2020-02-27T16:36:54.000Z | tests/test_visitors/test_ast/test_keywords/test_generator_keywords/test_yield_from_type.py | n1kolasM/wemake-python-styleguide | f39e87897de89bea1c49d410beb5b1cbaf930807 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from wemake_python_styleguide.violations.consistency import (
IncorrectYieldFromTargetViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
GeneratorKeywordsVisitor,
)
yield_from_template = """
def wrapper():
yield from {0}
"""
@pytest.mark.para... | 21.151515 | 70 | 0.645415 |
import pytest
from wemake_python_styleguide.violations.consistency import (
IncorrectYieldFromTargetViolation,
)
from wemake_python_styleguide.visitors.ast.keywords import (
GeneratorKeywordsVisitor,
)
yield_from_template = """
def wrapper():
yield from {0}
"""
@pytest.mark.parametrize('code', [
'... | true | true |
f7438d8caf2bd3d077b3b8da1d2980cec7face41 | 1,744 | py | Python | solutions/day13.py | nitekat1124/advent-of-code-2020 | 220434aff399ba094d5b0772214e92f5f3264269 | [
"WTFPL"
] | null | null | null | solutions/day13.py | nitekat1124/advent-of-code-2020 | 220434aff399ba094d5b0772214e92f5f3264269 | [
"WTFPL"
] | null | null | null | solutions/day13.py | nitekat1124/advent-of-code-2020 | 220434aff399ba094d5b0772214e92f5f3264269 | [
"WTFPL"
] | null | null | null | import math
from utils.solution_base import SolutionBase
class Solution(SolutionBase):
def solve(self, part_num: int):
self.test_runner(part_num)
func = getattr(self, f"part{part_num}")
result = func(self.data)
return result
def test_runner(self, part_num):
test_input... | 32.296296 | 124 | 0.545298 | import math
from utils.solution_base import SolutionBase
class Solution(SolutionBase):
def solve(self, part_num: int):
self.test_runner(part_num)
func = getattr(self, f"part{part_num}")
result = func(self.data)
return result
def test_runner(self, part_num):
test_input... | true | true |
f7438d9ecc8eceb41e12585b9b81484d7c841141 | 3,114 | py | Python | pycatia/in_interfaces/files.py | Tian-Jionglu/pycatia | b315aeb3a74846f134ff6b67b3a6334b9d3905fa | [
"MIT"
] | 1 | 2020-04-27T13:59:10.000Z | 2020-04-27T13:59:10.000Z | pycatia/in_interfaces/files.py | Luanee/pycatia | ea5eef8178f73de12404561c00baf7a7ca30da59 | [
"MIT"
] | null | null | null | pycatia/in_interfaces/files.py | Luanee/pycatia | ea5eef8178f73de12404561c00baf7a7ca30da59 | [
"MIT"
] | null | null | null | #! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... | 36.209302 | 108 | 0.496146 |
from pycatia.in_interfaces.file import File
from pycatia.system_interfaces.collection import Collection
class Files(Collection):
def __init__(self, com_object):
super().__init__(com_object, child_object=File)
self.files = com_object
def item(self, i_number: int) -> File:
return Fil... | true | true |
f7438dc360d188a1950f64197fde5346c02e3a71 | 3,583 | py | Python | forsta_auth/tests/settings.py | forsta-iam/forsta-auth | 9bc8c7c1033d95404c46fa351c7b689cc546a4d4 | [
"MIT"
] | null | null | null | forsta_auth/tests/settings.py | forsta-iam/forsta-auth | 9bc8c7c1033d95404c46fa351c7b689cc546a4d4 | [
"MIT"
] | 16 | 2019-07-10T13:40:12.000Z | 2022-02-10T07:32:53.000Z | forsta_auth/tests/settings.py | forsta-iam/forsta-auth | 9bc8c7c1033d95404c46fa351c7b689cc546a4d4 | [
"MIT"
] | null | null | null | import os
import environ
environ.Env.read_env(os.path.join(os.path.dirname(__file__), '..', '..', 'test.env'))
from ..settings import *
INSTALLED_APPS.append('forsta_brand')
SOCIAL_AUTH_SAML_SP_PRIVATE_KEY = """\
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCkR4S26dW8j+yO
fxLFjdeUQ... | 43.168675 | 85 | 0.903154 | import os
import environ
environ.Env.read_env(os.path.join(os.path.dirname(__file__), '..', '..', 'test.env'))
from ..settings import *
INSTALLED_APPS.append('forsta_brand')
SOCIAL_AUTH_SAML_SP_PRIVATE_KEY = """\
-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCkR4S26dW8j+yO
fxLFjdeUQ... | true | true |
f7438e6247780cd828ae4fb3639fa9a5f2d040ff | 2,440 | py | Python | deepy/data/audio/transform.py | popura/deepy-pytorch | 71d87a82e937d82b9b149041280a392cc24b7299 | [
"MIT"
] | 1 | 2021-07-19T09:38:26.000Z | 2021-07-19T09:38:26.000Z | deepy/data/audio/transform.py | popura/deepy-pytorch | 71d87a82e937d82b9b149041280a392cc24b7299 | [
"MIT"
] | 1 | 2021-07-26T06:47:45.000Z | 2021-07-26T06:47:45.000Z | deepy/data/audio/transform.py | popura/deepy-pytorch | 71d87a82e937d82b9b149041280a392cc24b7299 | [
"MIT"
] | null | null | null | import random
import torch
from deepy.data.transform import Transform, SeparatedTransform
from deepy.data.transform import PairedTransform, PairedCompose, ToPairedTransform
from deepy.nn import functional as myF
class RandomCrop(Transform):
def __init__(self, length: int, generator=None):
self.length = ... | 28.045977 | 102 | 0.62541 | import random
import torch
from deepy.data.transform import Transform, SeparatedTransform
from deepy.data.transform import PairedTransform, PairedCompose, ToPairedTransform
from deepy.nn import functional as myF
class RandomCrop(Transform):
def __init__(self, length: int, generator=None):
self.length = ... | true | true |
f7438eb4a05f5cd6ffeccf7d7c99d2b21fcaafc3 | 1,938 | py | Python | oneflow/python/test/ops/test_all_reduce_group.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 1 | 2021-04-14T03:19:35.000Z | 2021-04-14T03:19:35.000Z | oneflow/python/test/ops/test_all_reduce_group.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | 1 | 2021-06-16T08:37:50.000Z | 2021-06-16T08:37:50.000Z | oneflow/python/test/ops/test_all_reduce_group.py | wanghongsheng01/framework_enflame | debf613e05e3f5ea8084c3e79b60d0dd9e349526 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 applicable law or agr... | 32.3 | 83 | 0.726006 | from collections import OrderedDict
import numpy as np
import oneflow as flow
from test_util import GenArgList
import unittest
import os
def do_test(test_case, mirrored):
flow.clear_default_session()
flow.config.gpu_device_num(2)
func_config = flow.FunctionConfig()
if mirrored:
func_config.d... | true | true |
f7438ee35a8c34e3c0502ad08b7da8966f641519 | 1,751 | py | Python | aipmLib/InstallModel.py | bluejoe2008/aipm | 0c67c0e1082311e21574a8c143bdddc57264bb98 | [
"BSD-2-Clause"
] | null | null | null | aipmLib/InstallModel.py | bluejoe2008/aipm | 0c67c0e1082311e21574a8c143bdddc57264bb98 | [
"BSD-2-Clause"
] | null | null | null | aipmLib/InstallModel.py | bluejoe2008/aipm | 0c67c0e1082311e21574a8c143bdddc57264bb98 | [
"BSD-2-Clause"
] | null | null | null | import requests
import sys
import os
import configparser
dir = os.path.dirname(__file__)
root_dir = os.path.dirname(dir)
sys.path.append(root_dir)
from aipmLib.FetchModel import downloadModel
from aipmLib.FetchInfo import fetchInfo
# read the config
cp = configparser.ConfigParser()
cp.read(os.path.dirname(dir)+'/con... | 33.037736 | 87 | 0.733866 | import requests
import sys
import os
import configparser
dir = os.path.dirname(__file__)
root_dir = os.path.dirname(dir)
sys.path.append(root_dir)
from aipmLib.FetchModel import downloadModel
from aipmLib.FetchInfo import fetchInfo
cp = configparser.ConfigParser()
cp.read(os.path.dirname(dir)+'/config')
repo_url = ... | true | true |
f7438fb7972362af0e6a82e3fe654cfd9d62a05f | 9,310 | py | Python | flask_sqlite_web/sqliteFunctions.py | haibozhucloud/flask_sqlite_web | d0b407b359557bfd3cbb516d365f06c67f8d61d0 | [
"MIT"
] | 3 | 2019-01-15T06:49:34.000Z | 2021-08-06T02:57:20.000Z | flask_sqlite_web/sqliteFunctions.py | haibozhucloud/flask_sqlite_web | d0b407b359557bfd3cbb516d365f06c67f8d61d0 | [
"MIT"
] | null | null | null | flask_sqlite_web/sqliteFunctions.py | haibozhucloud/flask_sqlite_web | d0b407b359557bfd3cbb516d365f06c67f8d61d0 | [
"MIT"
] | null | null | null | #########################################
# Author : Haibo Zhu
# Email : haibo.zhu@hotmail.com
# created : 2018-11-06 13:38
# Last modified : 2018-11-08 14:49
# Filename : sqliteFunctions.py
# Description :
#########################################... | 30.12945 | 136 | 0.588829 | lue)
except Exception as e:
raise ValueError('Non integer value `%s` for field %s' % (self.value, self.colData['name']) )
@execRule(6)
def real(self):
if self.colData['dataType'].lower() in ['real','float','double','double precision']:
try:
float(self.value)
except Exception... | true | true |
f743908542b9f87b25127e9a77c568055a52272a | 256 | py | Python | parsl/tests/configs/local_threads_checkpoint_task_exit.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 323 | 2017-07-28T21:31:27.000Z | 2022-03-05T13:06:05.000Z | parsl/tests/configs/local_threads_checkpoint_task_exit.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 1,286 | 2017-06-01T16:50:00.000Z | 2022-03-31T16:45:14.000Z | parsl/tests/configs/local_threads_checkpoint_task_exit.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | 113 | 2017-06-03T11:38:40.000Z | 2022-03-26T16:43:05.000Z | from parsl.config import Config
from parsl.executors.threads import ThreadPoolExecutor
config = Config(
executors=[
ThreadPoolExecutor(
label='local_threads_checkpoint_task_exit',
)
],
checkpoint_mode='task_exit'
)
| 21.333333 | 55 | 0.695313 | from parsl.config import Config
from parsl.executors.threads import ThreadPoolExecutor
config = Config(
executors=[
ThreadPoolExecutor(
label='local_threads_checkpoint_task_exit',
)
],
checkpoint_mode='task_exit'
)
| true | true |
f74390b7131afec927ed9b643f5be7a71f9d542a | 3,140 | py | Python | tests/test_gamma.py | svalder/sntools | d6ef01dab4ee2f982582346e31f2bc35b5383cc1 | [
"BSD-3-Clause"
] | 10 | 2017-12-30T13:49:00.000Z | 2021-03-03T09:54:43.000Z | tests/test_gamma.py | svalder/sntools | d6ef01dab4ee2f982582346e31f2bc35b5383cc1 | [
"BSD-3-Clause"
] | 25 | 2017-11-15T17:01:43.000Z | 2022-03-29T16:21:43.000Z | tests/test_gamma.py | svalder/sntools | d6ef01dab4ee2f982582346e31f2bc35b5383cc1 | [
"BSD-3-Clause"
] | 11 | 2017-03-08T12:40:32.000Z | 2022-01-18T10:35:45.000Z | import unittest
from sntools.formats import gamma
class ParseInputTest(unittest.TestCase):
def setUp(self):
self.f = gamma.Flux()
def test_default_startendtime(self):
# test extracting default start- and endtime from sample input file
self.f.parse_input("fluxes/sample-gamma.txt", "e"... | 40.779221 | 102 | 0.638217 | import unittest
from sntools.formats import gamma
class ParseInputTest(unittest.TestCase):
def setUp(self):
self.f = gamma.Flux()
def test_default_startendtime(self):
self.f.parse_input("fluxes/sample-gamma.txt", "e", None, None)
self.assertEqual(self.f.starttime, 101)
... | true | true |
f74390dc1ffb67b9ee03c000512a4fea1f2fbec7 | 4,733 | py | Python | baseline/config.py | hellopikaqiu/AIchallenger_MachineReadingComprehension | 03c8d4ab60f6ac9c7f777fd2c932cc01300b5c42 | [
"MIT"
] | 94 | 2018-12-17T09:12:48.000Z | 2021-03-15T02:56:22.000Z | baseline/config.py | 1120327383/AIchallenger2018_MachineReadingComprehension | 03c8d4ab60f6ac9c7f777fd2c932cc01300b5c42 | [
"MIT"
] | 4 | 2019-03-10T03:20:18.000Z | 2020-06-02T05:10:46.000Z | baseline/config.py | 1120327383/AIchallenger2018_MachineReadingComprehension | 03c8d4ab60f6ac9c7f777fd2c932cc01300b5c42 | [
"MIT"
] | 24 | 2018-12-17T09:13:49.000Z | 2020-01-15T09:14:41.000Z | """
AI Challenger观点型问题阅读理解
config.py:配置文件,程序运行入口
@author: yuhaitao
"""
# -*- coding:utf-8 -*-
import os
import tensorflow as tf
import data_process
from main import train, test, dev
from file_save import *
from examine_dev import examine_dev
flags = tf.flags
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
train_file = os... | 36.976563 | 78 | 0.725333 |
import os
import tensorflow as tf
import data_process
from main import train, test, dev
from file_save import *
from examine_dev import examine_dev
flags = tf.flags
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
train_file = os.path.join("file", "ai_challenger_oqmrc_trainingset.json")
dev_file = os.path.join("file", "ai_... | true | true |
f74390e7d7a67a75cc63d5190d114d654983ae88 | 3,176 | py | Python | mars/serialization/aio.py | SimonCqk/mars | 167f1b70e074f01fa8dce4b771c4a42bd73a5587 | [
"Apache-2.0"
] | null | null | null | mars/serialization/aio.py | SimonCqk/mars | 167f1b70e074f01fa8dce4b771c4a42bd73a5587 | [
"Apache-2.0"
] | null | null | null | mars/serialization/aio.py | SimonCqk/mars | 167f1b70e074f01fa8dce4b771c4a42bd73a5587 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.408163 | 74 | 0.649559 |
import struct
from io import BytesIO
from typing import Any
from .core import pickle, serialize, deserialize
DEFAULT_SERIALIZATION_VERSION = 0
BUFFER_SIZES_NAME = 'buf_sizes'
class AioSerializer:
def __init__(self,
obj: Any,
compress=0):
self._obj = obj
... | true | true |
f743923290abed4fa6f89420ca872876c43fc129 | 11,747 | py | Python | machin/frame/buffers/buffer.py | ikamensh/machin | af7b423c47bc1412530cf6c96c11bd3af9b3e239 | [
"MIT"
] | 1 | 2021-04-01T21:21:23.000Z | 2021-04-01T21:21:23.000Z | machin/frame/buffers/buffer.py | ikamensh/machin | af7b423c47bc1412530cf6c96c11bd3af9b3e239 | [
"MIT"
] | null | null | null | machin/frame/buffers/buffer.py | ikamensh/machin | af7b423c47bc1412530cf6c96c11bd3af9b3e239 | [
"MIT"
] | null | null | null | from typing import Union, Dict, List, Tuple, Any, Callable
from ..transition import (
Transition,
Scalar,
TransitionStorageSmart,
TransitionStorageBasic,
)
import torch as t
import random
class Buffer:
def __init__(self, buffer_size, buffer_device="cpu", *_, **__):
"""
Create a buf... | 35.923547 | 87 | 0.543969 | from typing import Union, Dict, List, Tuple, Any, Callable
from ..transition import (
Transition,
Scalar,
TransitionStorageSmart,
TransitionStorageBasic,
)
import torch as t
import random
class Buffer:
def __init__(self, buffer_size, buffer_device="cpu", *_, **__):
self.buffer_size = buffe... | true | true |
f74394ad737d609e09ebd1303bbb71f5f0fcf648 | 6,071 | py | Python | gui/kivy/uix/dialogs/tx_dialog.py | ZeroHarbor/electrum | fdb810ba622dc7dbe1259cbafb5b28e19d2ab114 | [
"MIT"
] | 2 | 2019-03-21T07:23:07.000Z | 2019-03-21T16:35:19.000Z | gui/kivy/uix/dialogs/tx_dialog.py | ZeroHarbor/electrum | fdb810ba622dc7dbe1259cbafb5b28e19d2ab114 | [
"MIT"
] | null | null | null | gui/kivy/uix/dialogs/tx_dialog.py | ZeroHarbor/electrum | fdb810ba622dc7dbe1259cbafb5b28e19d2ab114 | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.uix.label import Label
from electrum_gui.kivy.i18n import _
from datetime import datetime
from electrum.util import InvalidPassword
Builder.load_str... | 34.106742 | 164 | 0.536814 | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.uix.label import Label
from electrum_gui.kivy.i18n import _
from datetime import datetime
from electrum.util import InvalidPassword
Builder.load_str... | true | true |
f74395aaa04c2a278117c706a3c28b27b4b00324 | 21,370 | py | Python | src/sage/functions/error.py | yzpopulation/sage | d2dc2f80b5a8e039701e292653e25366e3e5ec1e | [
"BSL-1.0"
] | 10 | 2018-06-01T21:54:53.000Z | 2022-03-14T20:11:34.000Z | src/sage/functions/error.py | yzpopulation/sage | d2dc2f80b5a8e039701e292653e25366e3e5ec1e | [
"BSL-1.0"
] | 1 | 2021-07-14T05:24:56.000Z | 2021-07-14T05:24:56.000Z | src/sage/functions/error.py | yzpopulation/sage | d2dc2f80b5a8e039701e292653e25366e3e5ec1e | [
"BSL-1.0"
] | 15 | 2020-07-23T10:46:25.000Z | 2022-01-25T15:37:24.000Z | r"""
Error Functions
This module provides symbolic error functions. These functions use the
`mpmath library` for numerical evaluation and Maxima, Pynac for
symbolics.
The main objects which are exported from this module are:
* :meth:`erf <Function_erf>` -- The error function
* :meth:`erfc <Function_erfc>` -- The c... | 27.789337 | 99 | 0.504445 |
from sage.structure.all import parent as s_parent
from sage.symbolic.function import BuiltinFunction
from sage.libs.mpmath import utils as mpmath_utils
from sage.symbolic.expression import Expression
from sage.functions.all import sqrt, exp
from sage.symbolic.constants import pi
from sage.rings.rational impo... | true | true |
f74397191a792e90aa3938fe2bd7f0d93af27e6f | 79,674 | py | Python | sdk/lusid/api/portfolios_api.py | inwaves/lusid-sdk-python | 9ad2cfc71c998928bf23f54ce0821a8ea2db556b | [
"MIT"
] | null | null | null | sdk/lusid/api/portfolios_api.py | inwaves/lusid-sdk-python | 9ad2cfc71c998928bf23f54ce0821a8ea2db556b | [
"MIT"
] | null | null | null | sdk/lusid/api/portfolios_api.py | inwaves/lusid-sdk-python | 9ad2cfc71c998928bf23f54ce0821a8ea2db556b | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.2342
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa: F401
# python 2 and python 3 compatibility lib... | 61.006126 | 384 | 0.640447 |
from __future__ import absolute_import
import re
import six
from lusid.api_client import ApiClient
from lusid.exceptions import (
ApiTypeError,
ApiValueError
)
class PortfoliosApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
... | true | true |
f74397d4f6673195a87b4d92ea190ef5e7da8518 | 3,321 | py | Python | Python/Examples/FilterTarget.py | sunoval2016/RoboDK-API | 47a4905f8021b5b75fea0300136ea1ea8bb3e33d | [
"Apache-2.0"
] | 161 | 2018-03-23T01:27:08.000Z | 2022-03-23T12:18:35.000Z | Python/Examples/FilterTarget.py | sunoval2016/RoboDK-API | 47a4905f8021b5b75fea0300136ea1ea8bb3e33d | [
"Apache-2.0"
] | 26 | 2018-11-19T10:18:58.000Z | 2022-03-28T18:37:11.000Z | Python/Examples/FilterTarget.py | sunoval2016/RoboDK-API | 47a4905f8021b5b75fea0300136ea1ea8bb3e33d | [
"Apache-2.0"
] | 85 | 2018-03-22T19:25:35.000Z | 2022-03-30T04:46:59.000Z | # This script shows how to filter an existing target as a pose
# This is useful for a robot that has been calibrated and we need to get the filtered pose
# Important: It is assumed that the robot will reach the pose with the calculated configuration
from robolink import * # API to communicate with RoboDK
from robod... | 39.535714 | 125 | 0.750075 |
from robolink import *
from robodk import *
def XYZWPR_2_Pose(xyzwpr):
return KUKA_2_Pose(xyzwpr)
def Pose_2_XYZWPR(pose):
return Pose_2_KUKA(pose)
RDK = Robolink()
robot = RDK.Item('', ITEM_TYPE_ROBOT)
if not robot.Valid():
raise Exception("Robot not available")
pose_tcp =... | true | true |
f7439805e1fe73d5ab3646e43781244080a4bb82 | 13,165 | py | Python | valid/non_regression.py | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | null | null | null | valid/non_regression.py | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | null | null | null | valid/non_regression.py | metalibm/metalibm-clone | d04839e58950a156b79b763b9f45cb874e21ebfe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# This file is part of metalibm (https://github.com/kalray/metalibm)
# MIT License
#
# Copyright (c) 2018 Kalray
#
# 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 wit... | 33.329114 | 181 | 0.704899 |
import argparse
import sys
import re
from sollya import Interval, SollyaObject
S2 = SollyaObject(2)
import metalibm_functions.ml_log10
import metalibm_functions.ml_log1p
import metalibm_functions.ml_log2
import metalibm_functions.ml_log
import metalibm_functions.ml_exp
import metalibm_fun... | true | true |
f74398117338ba0a450db2c0cf939653fa2b68e7 | 1,856 | py | Python | guillotina_volto/tests/test_search.py | enfold/guillotina-volto | d38ee300470c813c99341eaeb2ba8a2b5fb7d778 | [
"BSD-2-Clause"
] | 1 | 2020-11-14T13:09:49.000Z | 2020-11-14T13:09:49.000Z | guillotina_volto/tests/test_search.py | enfold/guillotina-volto | d38ee300470c813c99341eaeb2ba8a2b5fb7d778 | [
"BSD-2-Clause"
] | 4 | 2021-05-14T20:21:03.000Z | 2021-11-18T01:27:04.000Z | guillotina_volto/tests/test_search.py | enfold/guillotina-volto | d38ee300470c813c99341eaeb2ba8a2b5fb7d778 | [
"BSD-2-Clause"
] | null | null | null | import pytest
import json
from guillotina_volto.tests.utils import add_content
from guillotina.tests.test_catalog import PG_CATALOG_SETTINGS, NOT_POSTGRES
pytestmark = pytest.mark.asyncio
@pytest.mark.app_settings(PG_CATALOG_SETTINGS)
@pytest.mark.skipif(NOT_POSTGRES, reason="Only PG")
async def test_search(cms_requ... | 32.561404 | 88 | 0.584052 | import pytest
import json
from guillotina_volto.tests.utils import add_content
from guillotina.tests.test_catalog import PG_CATALOG_SETTINGS, NOT_POSTGRES
pytestmark = pytest.mark.asyncio
@pytest.mark.app_settings(PG_CATALOG_SETTINGS)
@pytest.mark.skipif(NOT_POSTGRES, reason="Only PG")
async def test_search(cms_requ... | true | true |
f74398b24efc276185198b125ec0cf502e463917 | 741 | py | Python | blinkled/led/migrations/0005_auto_20190408_1029.py | Daniellee17/DJANGO-RaspberryPi4-IOT | fa0dfd00a4d1eea817c209d064aa867ac873db3b | [
"Apache-2.0"
] | 1 | 2019-04-08T10:48:03.000Z | 2019-04-08T10:48:03.000Z | blinkled/led/migrations/0005_auto_20190408_1029.py | Daniellee17/DJANGO-RaspberryPi4-IOT | fa0dfd00a4d1eea817c209d064aa867ac873db3b | [
"Apache-2.0"
] | null | null | null | blinkled/led/migrations/0005_auto_20190408_1029.py | Daniellee17/DJANGO-RaspberryPi4-IOT | fa0dfd00a4d1eea817c209d064aa867ac873db3b | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.7 on 2019-04-08 10:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('led', '0004_sensors_action'),
]
operations = [
migrations.AlterField(
model_name='sensors',
name='humidity',
... | 25.551724 | 65 | 0.5722 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('led', '0004_sensors_action'),
]
operations = [
migrations.AlterField(
model_name='sensors',
name='humidity',
field=models.FloatField(default=0.0, max_l... | true | true |
f74398dd55760dc5b1c15762f6837bcafdac7e17 | 87 | py | Python | test_file/delete_test.py | aurora314156/pokemondex | d65b5fe63845c71d00435e9bd5ffc06bf3de1476 | [
"MIT"
] | null | null | null | test_file/delete_test.py | aurora314156/pokemondex | d65b5fe63845c71d00435e9bd5ffc06bf3de1476 | [
"MIT"
] | null | null | null | test_file/delete_test.py | aurora314156/pokemondex | d65b5fe63845c71d00435e9bd5ffc06bf3de1476 | [
"MIT"
] | null | null | null | from requests import delete
delete('http://localhost:5000/delete_pokemon/0010').json() | 29 | 58 | 0.793103 | from requests import delete
delete('http://localhost:5000/delete_pokemon/0010').json() | true | true |
f7439a2fff98122503cb74140024f1afc1d29019 | 1,204 | py | Python | all codes/MKCHNGE04.py | Rijul24/Codechef-Codes | 3715c3e3ed8232540fb7fcbcae8c2ee7434d90c9 | [
"MIT"
] | null | null | null | all codes/MKCHNGE04.py | Rijul24/Codechef-Codes | 3715c3e3ed8232540fb7fcbcae8c2ee7434d90c9 | [
"MIT"
] | null | null | null | all codes/MKCHNGE04.py | Rijul24/Codechef-Codes | 3715c3e3ed8232540fb7fcbcae8c2ee7434d90c9 | [
"MIT"
] | null | null | null | n , v = list(map(float , input().split()))
arr = list(map(float , input().split()))
n = int(n)
arr.sort(reverse = True)
def coins(arr , v , k1 , res):
ans =0.00
orig_v = k1
for ele in arr:
flag = True
i = 1.00
while flag == True:
... | 23.607843 | 62 | 0.317276 | n , v = list(map(float , input().split()))
arr = list(map(float , input().split()))
n = int(n)
arr.sort(reverse = True)
def coins(arr , v , k1 , res):
ans =0.00
orig_v = k1
for ele in arr:
flag = True
i = 1.00
while flag == True:
... | true | true |
f7439ab78d76cf8c76025f5a474f54052621ce62 | 5,554 | py | Python | tfx/tools/cli/e2e/test_utils.py | ettiee/tfx | 8e60b158df72d1e6811ade1c934f68d08df25a0c | [
"Apache-2.0"
] | 1 | 2020-11-24T16:59:37.000Z | 2020-11-24T16:59:37.000Z | tfx/tools/cli/e2e/test_utils.py | ettiee/tfx | 8e60b158df72d1e6811ade1c934f68d08df25a0c | [
"Apache-2.0"
] | null | null | null | tfx/tools/cli/e2e/test_utils.py | ettiee/tfx | 8e60b158df72d1e6811ade1c934f68d08df25a0c | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 38.569444 | 79 | 0.776197 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from typing import List, Text
from tfx.components.base.base_component import BaseComponent
from tfx.components.evaluator.component import Evaluator
from tfx.components.example_gen.csv_... | true | true |
f7439d3461304e2c7928499fb8b9061f8a05520c | 1,323 | py | Python | project_euler/problem_31/sol1.py | KirilBangachev/Python | 7ad45a46e02edda86a45969de8768f26ef44b306 | [
"MIT"
] | 3 | 2019-10-11T20:50:59.000Z | 2020-01-21T02:10:10.000Z | project_euler/problem_31/sol1.py | KirilBangachev/Python | 7ad45a46e02edda86a45969de8768f26ef44b306 | [
"MIT"
] | 1 | 2019-09-01T06:43:06.000Z | 2019-09-01T06:44:55.000Z | project_euler/problem_31/sol1.py | KirilBangachev/Python | 7ad45a46e02edda86a45969de8768f26ef44b306 | [
"MIT"
] | 3 | 2020-08-05T02:33:42.000Z | 2020-10-13T02:47:01.000Z | # -*- coding: utf-8 -*-
"""
Coin sums
Problem 31
In England the currency is made up of pound, £, and pence, p, and there are
eight coins in general circulation:
1p, 2p, 5p, 10p, 20p, 50p, £1 (100p) and £2 (200p).
It is possible to make £2 in the following way:
1×£1 + 1×50p + 2×20p + 1×5p + 1×2p + 3×1p
How many differ... | 20.671875 | 78 | 0.62585 |
def one_pence():
return 1
def two_pence(x):
return 0 if x < 0 else two_pence(x - 2) + one_pence()
def five_pence(x):
return 0 if x < 0 else five_pence(x - 5) + two_pence(x)
def ten_pence(x):
return 0 if x < 0 else ten_pence(x - 10) + five_pence(x)
def twenty_pence(x):
return 0 if x < 0 else... | true | true |
f7439d4143c5e6c72e98378466bd3bd3e50f5a77 | 3,377 | py | Python | lib/MotifUtils/Utils/MemeUtil.py | arwyer/MotifUtils | 6568303b0894e44fa6fd7cc0de1022a9c4356555 | [
"MIT"
] | 1 | 2019-07-20T05:53:21.000Z | 2019-07-20T05:53:21.000Z | lib/MotifUtils/Utils/MemeUtil.py | man4ish/MotifUtils | 96ab9d99588a46ffe786c735fd74e1c51801762a | [
"MIT"
] | null | null | null | lib/MotifUtils/Utils/MemeUtil.py | man4ish/MotifUtils | 96ab9d99588a46ffe786c735fd74e1c51801762a | [
"MIT"
] | 1 | 2019-05-22T16:35:41.000Z | 2019-05-22T16:35:41.000Z | from .MotifUtil import MotifUtil
from pprint import pprint as pp
class MEMEUtil:
def __init__(self, config):
self.scratch = config['scratch']
self.MotifUtil = MotifUtil(config)
# parse output into old motif format(maybe new format if thats useful?)
def parse(self, outputFile, params):
... | 37.522222 | 95 | 0.420788 | from .MotifUtil import MotifUtil
from pprint import pprint as pp
class MEMEUtil:
def __init__(self, config):
self.scratch = config['scratch']
self.MotifUtil = MotifUtil(config)
def parse(self, outputFile, params):
file = open(outputFile,'r')
starCount = 0
countSt... | true | true |
f7439d7152d662584b1fc860caa7164efccf59bd | 2,517 | py | Python | setup.py | pmdevita/praw | 6e99549bb1bb41b69007165e51de05924d648d95 | [
"BSD-2-Clause"
] | null | null | null | setup.py | pmdevita/praw | 6e99549bb1bb41b69007165e51de05924d648d95 | [
"BSD-2-Clause"
] | null | null | null | setup.py | pmdevita/praw | 6e99549bb1bb41b69007165e51de05924d648d95 | [
"BSD-2-Clause"
] | null | null | null | """praw setup.py"""
import re
from codecs import open
from os import path
from setuptools import find_packages, setup
PACKAGE_NAME = "praw"
HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, "README.rst"), encoding="utf-8") as fp:
README = fp.read()
with open(path.join(HERE, PACKAGE_NAME, "con... | 31.074074 | 91 | 0.58085 |
import re
from codecs import open
from os import path
from setuptools import find_packages, setup
PACKAGE_NAME = "praw"
HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, "README.rst"), encoding="utf-8") as fp:
README = fp.read()
with open(path.join(HERE, PACKAGE_NAME, "const.py"), encoding="u... | true | true |
f7439d85a9158f5661f960489c775ae8e9b1921b | 250 | py | Python | Python_Programs/LeapYear.py | silvisharma/RTU-DigitalLibrary | c023273b121b9d9315598e55c688b1e450789164 | [
"MIT"
] | null | null | null | Python_Programs/LeapYear.py | silvisharma/RTU-DigitalLibrary | c023273b121b9d9315598e55c688b1e450789164 | [
"MIT"
] | null | null | null | Python_Programs/LeapYear.py | silvisharma/RTU-DigitalLibrary | c023273b121b9d9315598e55c688b1e450789164 | [
"MIT"
] | null | null | null | year=int(input("Enter a year:"))
if(year%4==0 and year%100!=0):
print("It is a leap year")
elif(year%400==0):
print("It is a leap year")
elif(year%100==0):
print("It is not a leap year")
else:
print("It is not a leap year") | 27.777778 | 36 | 0.588 | year=int(input("Enter a year:"))
if(year%4==0 and year%100!=0):
print("It is a leap year")
elif(year%400==0):
print("It is a leap year")
elif(year%100==0):
print("It is not a leap year")
else:
print("It is not a leap year") | true | true |
f7439e0699956b8365ff579e1bbdda93b2fb6b46 | 2,197 | py | Python | pipeline/core/pipeline.py | dtlisir/bk_sops | c39a23681e1fb2408ae93cebea20eb2a7dcec8ea | [
"Apache-2.0"
] | 1 | 2019-05-21T06:44:18.000Z | 2019-05-21T06:44:18.000Z | pipeline/core/pipeline.py | dtlisir/bk_sops | c39a23681e1fb2408ae93cebea20eb2a7dcec8ea | [
"Apache-2.0"
] | 9 | 2020-06-05T21:18:43.000Z | 2021-06-10T21:34:38.000Z | pipeline/core/pipeline.py | dtlisir/bk_sops | c39a23681e1fb2408ae93cebea20eb2a7dcec8ea | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 33.8 | 305 | 0.675922 |
from __future__ import absolute_import
from pipeline.exceptions import PipelineException
class PipelineSpec(object):
def __init__(self, start_event, end_event, flows, activities, gateways, data, context):
objects = {
start_event.id: start_event,
end_event.id: end_event
}
... | true | true |
f7439ffeb275503dc62106dd242157ef7f1762a1 | 4,837 | py | Python | app/user/tests/test_user_api.py | BenoCharlo/Recipe-app-api | 849f6e5eb628d8724d1c0deac47ab0b78a89f9bb | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | BenoCharlo/Recipe-app-api | 849f6e5eb628d8724d1c0deac47ab0b78a89f9bb | [
"MIT"
] | null | null | null | app/user/tests/test_user_api.py | BenoCharlo/Recipe-app-api | 849f6e5eb628d8724d1c0deac47ab0b78a89f9bb | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse("user:create")
TOKEN_URL = reverse("user:token")
ME_URL = reverse("user:me")
def create_user(**params)... | 36.368421 | 77 | 0.660533 | from django.test import TestCase
from django.contrib.auth import get_user_model
from django.urls import reverse
from rest_framework.test import APIClient
from rest_framework import status
CREATE_USER_URL = reverse("user:create")
TOKEN_URL = reverse("user:token")
ME_URL = reverse("user:me")
def create_user(**params)... | true | true |
f743a00068dbff8491e4ba20a9e179d3d77d6edb | 4,581 | py | Python | HackINonE.py | Coldwave96/HackINonE | 06236b7c2b03ef1481798e084e3f27430069eac9 | [
"Apache-2.0"
] | 5 | 2020-08-10T07:26:04.000Z | 2022-01-11T07:40:15.000Z | HackINonE.py | Coldwave96/HackINonE | 06236b7c2b03ef1481798e084e3f27430069eac9 | [
"Apache-2.0"
] | null | null | null | HackINonE.py | Coldwave96/HackINonE | 06236b7c2b03ef1481798e084e3f27430069eac9 | [
"Apache-2.0"
] | 3 | 2021-01-14T03:03:04.000Z | 2021-11-30T06:46:02.000Z | #!/usr/bin python3
# coding: UTF-8
import os
import webbrowser
from time import sleep
from platform import system
from core import HackINonECollection
from tools.anonsurf import AnonSurfTools
from tools.ddos import DDOSTools
from tools.exploit_frameworks import ExploitFrameworkTools
from tools.forensic_tools import F... | 34.443609 | 93 | 0.577167 |
import os
import webbrowser
from time import sleep
from platform import system
from core import HackINonECollection
from tools.anonsurf import AnonSurfTools
from tools.ddos import DDOSTools
from tools.exploit_frameworks import ExploitFrameworkTools
from tools.forensic_tools import ForensicTools
from tools.informati... | true | true |
f743a20fee76437ababbad61f78a4eab6fe4b2a0 | 643 | py | Python | atune_collector/plugin/configurator/script/__init__.py | openeuler-mirror/A-Tune-Collector | ce1d990034eb3fbdcc8e0101be955a7370bdc6c8 | [
"MulanPSL-1.0"
] | null | null | null | atune_collector/plugin/configurator/script/__init__.py | openeuler-mirror/A-Tune-Collector | ce1d990034eb3fbdcc8e0101be955a7370bdc6c8 | [
"MulanPSL-1.0"
] | null | null | null | atune_collector/plugin/configurator/script/__init__.py | openeuler-mirror/A-Tune-Collector | ce1d990034eb3fbdcc8e0101be955a7370bdc6c8 | [
"MulanPSL-1.0"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Copyright (c) 2019 Huawei Technologies Co., Ltd.
# A-Tune is licensed under the Mulan PSL v2.
# You can use this software according to the terms and conditions of the Mulan PSL v2.
# You may obtain a copy of Mulan PSL v2 at:
# http://license.coscl.org.cn/MulanPSL2
# THIS... | 30.619048 | 98 | 0.715397 |
__all__ = ["script"]
from . import *
| true | true |
f743a2ccaacbbbdd30a09f70559e0cef01972751 | 24,384 | py | Python | official/nlp/modeling/networks/encoder_scaffold_test.py | akshit-protonn/models | 38c8c6fe4144c93d6aadd19981c2b90570c29eba | [
"Apache-2.0"
] | 1 | 2021-05-12T08:34:32.000Z | 2021-05-12T08:34:32.000Z | official/nlp/modeling/networks/encoder_scaffold_test.py | akshit-protonn/models | 38c8c6fe4144c93d6aadd19981c2b90570c29eba | [
"Apache-2.0"
] | 2 | 2021-05-09T07:09:43.000Z | 2021-05-09T07:11:45.000Z | official/nlp/modeling/networks/encoder_scaffold_test.py | akshit-protonn/models | 38c8c6fe4144c93d6aadd19981c2b90570c29eba | [
"Apache-2.0"
] | 2 | 2017-12-21T08:58:36.000Z | 2018-12-24T05:53:51.000Z | # Copyright 2021 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... | 36.667669 | 101 | 0.684301 |
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import keras_parameterized
from official.modeling import activations
from official.nlp.modeling import layers
from official.nlp.modeling.networks import encoder_scaffold
@tf.keras.utils... | true | true |
f743a340b22cb1ab0e5683d44f59e24ee0ca067d | 769 | py | Python | app/core/admin.py | varannik/insta-api | a6bfe8e102faf09adc95641251e5e02c5177e6cd | [
"MIT"
] | null | null | null | app/core/admin.py | varannik/insta-api | a6bfe8e102faf09adc95641251e5e02c5177e6cd | [
"MIT"
] | null | null | null | app/core/admin.py | varannik/insta-api | a6bfe8e102faf09adc95641251e5e02c5177e6cd | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext as _
from core import models
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(None, {'fields': ('email', ... | 26.517241 | 65 | 0.559168 | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from django.utils.translation import gettext as _
from core import models
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
fieldsets = (
(None, {'fields': ('email', ... | true | true |
f743a4ddc8b95ba7264147125baf6a6cb2690082 | 3,155 | py | Python | test/python/topology/test2_unicode.py | natashadsilva/streamsx.topology | c23f2cb98ca8b77b658c322b11226b9960c35df4 | [
"Apache-2.0"
] | null | null | null | test/python/topology/test2_unicode.py | natashadsilva/streamsx.topology | c23f2cb98ca8b77b658c322b11226b9960c35df4 | [
"Apache-2.0"
] | null | null | null | test/python/topology/test2_unicode.py | natashadsilva/streamsx.topology | c23f2cb98ca8b77b658c322b11226b9960c35df4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Licensed Materials - Property of IBM
# Copyright IBM Corp. 2017
from __future__ import print_function
import unittest
from streamsx.topology.topology import *
from streamsx.topology.tester import Tester
from streamsx.topology import context
from streamsx.topology.context import ConfigParams
from strea... | 33.924731 | 79 | 0.631696 |
from __future__ import print_function
import unittest
from streamsx.topology.topology import *
from streamsx.topology.tester import Tester
from streamsx.topology import context
from streamsx.topology.context import ConfigParams
from streamsx import rest
import streamsx.ec as ec
class TestUnicode(unittest.TestCase... | true | true |
f743a6a65cd538a4a973ff0463ec20b8a413e05b | 1,154 | py | Python | hyper_shell/__meta__.py | glentner/hyper-shell | 361f766cd6a52f7c15b98b95424d7ce3c18b2160 | [
"Apache-2.0"
] | 2 | 2020-04-23T15:05:54.000Z | 2020-04-23T16:12:10.000Z | hyper_shell/__meta__.py | glentner/hyper-shell | 361f766cd6a52f7c15b98b95424d7ce3c18b2160 | [
"Apache-2.0"
] | 9 | 2020-03-19T19:12:36.000Z | 2022-02-26T04:23:59.000Z | hyper_shell/__meta__.py | glentner/hyper-shell | 361f766cd6a52f7c15b98b95424d7ce3c18b2160 | [
"Apache-2.0"
] | null | null | null | # This program is free software: you can redistribute it and/or modify it under the
# terms of the Apache License (v2.0) as published by the Apache Software Foundation.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or... | 46.16 | 102 | 0.759099 |
__appname__ = 'hyper-shell'
__version__ = '1.8.3'
__authors__ = 'Geoffrey Lentner'
__contact__ = 'glentner@purdue.edu'
__license__ = 'Apache Software License'
__copyright__ = 'Copyright Geoffrey Lentner 2019. All Rights Reserved.'
__website__ = 'https://github.com/glentner/hyper-she... | true | true |
f743a6c0a6effcdf93bc44d591b3304c678c01bd | 472 | py | Python | Project for fun/Hotel/project/rooms/young_couple.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | null | null | null | Project for fun/Hotel/project/rooms/young_couple.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | null | null | null | Project for fun/Hotel/project/rooms/young_couple.py | DonikaChervenkova/SoftUni | bff579c037ec48f39ed193b34bc3502a32e90732 | [
"MIT"
] | 1 | 2021-12-04T12:30:57.000Z | 2021-12-04T12:30:57.000Z | from project.appliances.fridge import Fridge
from project.appliances.laptop import Laptop
from project.appliances.tv import TV
from project.rooms.room import Room
class YoungCouple (Room):
def __init__(self, family_name: str, salary_one: float, salary_two: float):
super().__init__(family_name, salary_one ... | 33.714286 | 79 | 0.726695 | from project.appliances.fridge import Fridge
from project.appliances.laptop import Laptop
from project.appliances.tv import TV
from project.rooms.room import Room
class YoungCouple (Room):
def __init__(self, family_name: str, salary_one: float, salary_two: float):
super().__init__(family_name, salary_one ... | true | true |
f743a71aff5ca5b0de5c021ff36ab133f44fa106 | 1,879 | py | Python | Dependencies/gyp-master/test/win/gyptest-link-base-address.py | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/win/gyptest-link-base-address.py | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | Dependencies/gyp-master/test/win/gyptest-link-base-address.py | knight666/exlibris | b21b46e0c84e5c4f81f8048022cda88e7bb3dca2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Make sure the base address setting is extracted properly.
"""
import TestGyp
import re
import sys
if sys.platform == 'win3... | 29.825397 | 75 | 0.711016 |
import TestGyp
import re
import sys
if sys.platform == 'win32':
test = TestGyp.TestGyp(formats=['msvs', 'ninja'])
CHDIR = 'linker-flags'
test.run_gyp('base-address.gyp', chdir=CHDIR)
test.build('base-address.gyp', test.ALL, chdir=CHDIR)
def GetHeaders(exe):
full_path = test.buil... | true | true |
f743a77d6c8670717d8bb86ea600fd6756196c82 | 1,856 | py | Python | exclusivity_correlation.py | emcoglab/sensorimotor-distance-paper-2021 | 94464bb391ea42ffad8bcef6b087c1343ecbe2c7 | [
"CC-BY-4.0"
] | 1 | 2021-09-28T15:28:17.000Z | 2021-09-28T15:28:17.000Z | exclusivity_correlation.py | emcoglab/sensorimotor-distance-paper-2021 | 94464bb391ea42ffad8bcef6b087c1343ecbe2c7 | [
"CC-BY-4.0"
] | null | null | null | exclusivity_correlation.py | emcoglab/sensorimotor-distance-paper-2021 | 94464bb391ea42ffad8bcef6b087c1343ecbe2c7 | [
"CC-BY-4.0"
] | null | null | null | """
===========================
Computes the correlation between pairwise distances and mean exclusivity ratings for randomly drawn pairs of norms.
===========================
Dr. Cai Wingfield
---------------------------
Embodied Cognition Lab
Department of Psychology
University of Lancaster
c.wingfield@lancaster.ac.... | 33.142857 | 137 | 0.70097 |
from numpy import corrcoef, zeros
from numpy.random import default_rng, seed
from linguistic_distributional_models.utils.logging import print_progress
from linguistic_distributional_models.utils.maths import DistanceType, distance
from sensorimotor_norms.sensorimotor_norms import SensorimotorNorms, DataColNames
sn =... | true | true |
f743a782f0bedf37e967a1747a5346c9b60167b9 | 2,710 | py | Python | app/request.py | Ianadika44/higlights | 8bdb78dc068565e869a735848657b728fb12bb56 | [
"Unlicense"
] | null | null | null | app/request.py | Ianadika44/higlights | 8bdb78dc068565e869a735848657b728fb12bb56 | [
"Unlicense"
] | null | null | null | app/request.py | Ianadika44/higlights | 8bdb78dc068565e869a735848657b728fb12bb56 | [
"Unlicense"
] | null | null | null | import urllib.request,json
from .models import models
# Article = article.Article
Source = models.Source
Article = models.Article
# Getting api key
api_key = None
# Getting the movie base url
base_url = None
def configure_request(app):
global api_key,base_url
api_key = app.config['NEWS_API_KEY']
base_u... | 28.829787 | 110 | 0.685609 | import urllib.request,json
from .models import models
Source = models.Source
Article = models.Article
api_key = None
base_url = None
def configure_request(app):
global api_key,base_url
api_key = app.config['NEWS_API_KEY']
base_url = app.config["NEWS_API_BASE_URL"]
def get_articles(filter):
... | true | true |
f743a7daced77fed3d51460ec7e573495b571b1a | 2,713 | py | Python | xiamiu/models.py | Vida42/xiamiu | 9249a20746d1da050546e3fcdfafbc5ff49ab4d0 | [
"Apache-2.0"
] | null | null | null | xiamiu/models.py | Vida42/xiamiu | 9249a20746d1da050546e3fcdfafbc5ff49ab4d0 | [
"Apache-2.0"
] | null | null | null | xiamiu/models.py | Vida42/xiamiu | 9249a20746d1da050546e3fcdfafbc5ff49ab4d0 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class Artist(models.Model):
artistID = models.CharField(db_column='artistID', max_length=20, primary_key=True)
artistName = models.CharField(db_column='artistName', max_length=50)
genreReign = models.CharField(db_column='artistReign', max_length=50)
class Meta:
ma... | 36.662162 | 111 | 0.705861 | from django.db import models
class Artist(models.Model):
artistID = models.CharField(db_column='artistID', max_length=20, primary_key=True)
artistName = models.CharField(db_column='artistName', max_length=50)
genreReign = models.CharField(db_column='artistReign', max_length=50)
class Meta:
ma... | true | true |
f743a8aac83064ede9991b5102db4690ad2a0d24 | 1,848 | py | Python | pytorch_toolkit/action_recognition/action_recognition/models/multi_frame_baseline.py | AnastasiaaSenina/openvino_training_extensions | 267425d64372dff5b9083dc0ca6abfc305a71449 | [
"Apache-2.0"
] | 1 | 2020-02-09T15:50:49.000Z | 2020-02-09T15:50:49.000Z | pytorch_toolkit/action_recognition/action_recognition/models/multi_frame_baseline.py | AnastasiaaSenina/openvino_training_extensions | 267425d64372dff5b9083dc0ca6abfc305a71449 | [
"Apache-2.0"
] | null | null | null | pytorch_toolkit/action_recognition/action_recognition/models/multi_frame_baseline.py | AnastasiaaSenina/openvino_training_extensions | 267425d64372dff5b9083dc0ca6abfc305a71449 | [
"Apache-2.0"
] | 1 | 2022-01-03T18:14:35.000Z | 2022-01-03T18:14:35.000Z | from torch import nn as nn
from torch.nn import functional as F
from ..utils import get_fine_tuning_parameters
from .backbone import make_encoder
from .modules import squash_dims, unsquash_dim
class MultiFrameBaseline(nn.Module):
"""Simple baseline that runs a classifier on each frame independently and averages ... | 35.538462 | 116 | 0.659632 | from torch import nn as nn
from torch.nn import functional as F
from ..utils import get_fine_tuning_parameters
from .backbone import make_encoder
from .modules import squash_dims, unsquash_dim
class MultiFrameBaseline(nn.Module):
def __init__(self, sample_duration, encoder='resnet34', n_classes=400, input_size=... | true | true |
f743a94cc358a421469af01c74a6c5c4c13d36a6 | 7,338 | py | Python | src/tests/test_vesync_15a.py | dstao3489/pyvesync | 5cf2c8b667aae0dd7b82d93619f277fc6e7c8800 | [
"MIT"
] | null | null | null | src/tests/test_vesync_15a.py | dstao3489/pyvesync | 5cf2c8b667aae0dd7b82d93619f277fc6e7c8800 | [
"MIT"
] | null | null | null | src/tests/test_vesync_15a.py | dstao3489/pyvesync | 5cf2c8b667aae0dd7b82d93619f277fc6e7c8800 | [
"MIT"
] | null | null | null | import pytest
from unittest.mock import patch
import logging
from pyvesync import VeSync, VeSyncOutlet15A
from pyvesync.helpers import Helpers as helpers
from . import call_json
DEV_LIST_DETAIL = call_json.LIST_CONF_15A
CORRECT_15A_LIST = call_json.DEVLIST_15A
ENERGY_HISTORY = call_json.ENERGY_HISTORY
CORRECT_15A_D... | 40.766667 | 74 | 0.657945 | import pytest
from unittest.mock import patch
import logging
from pyvesync import VeSync, VeSyncOutlet15A
from pyvesync.helpers import Helpers as helpers
from . import call_json
DEV_LIST_DETAIL = call_json.LIST_CONF_15A
CORRECT_15A_LIST = call_json.DEVLIST_15A
ENERGY_HISTORY = call_json.ENERGY_HISTORY
CORRECT_15A_D... | true | true |
f743aa06d2801786334b5f594cdbd0296a8718c8 | 27,582 | py | Python | mscreen/autodocktools_prepare_py3k/AutoDockTools/WebServices.py | e-mayo/mscreen | a50f0b2f7104007c730baa51b4ec65c891008c47 | [
"MIT"
] | 9 | 2021-03-06T04:24:28.000Z | 2022-01-03T09:53:07.000Z | AutoDockTools/WebServices.py | e-mayo/autodocktools-prepare-py3k | 2dd2316837bcb7c19384294443b2855e5ccd3e01 | [
"BSD-3-Clause"
] | 3 | 2021-03-07T05:37:16.000Z | 2021-09-19T15:06:54.000Z | AutoDockTools/WebServices.py | e-mayo/autodocktools-prepare-py3k | 2dd2316837bcb7c19384294443b2855e5ccd3e01 | [
"BSD-3-Clause"
] | 4 | 2019-08-28T23:11:39.000Z | 2021-11-27T08:43:36.000Z | #$Header: /opt/cvs/python/packages/share1.5/AutoDockTools/WebServices.py,v 1.21 2009/08/12 21:40:05 lclement Exp $
#$Id: WebServices.py,v 1.21 2009/08/12 21:40:05 lclement Exp $
# Author: Sargis Dallakyan (sargis@scripps.edu)
import tkinter, Pmw, os, http.client, webbrowser, urllib.request, urllib.parse, urllib.error,... | 47.473322 | 114 | 0.526974 |
import tkinter, Pmw, os, http.client, webbrowser, urllib.request, urllib.parse, urllib.error, re
from ViewerFramework.VFCommand import CommandGUI, Command
from Pmv.mvCommand import MVCommand
from .autostartCommands import menuText
from mglutil.gui.InputForm.Tk.gui import InputFormDescr
from mglutil.util.packageFile... | true | true |
f743ab9258579a220344eac765a48160c12d49df | 412 | py | Python | tasks-around-university/rest/maingame/migrations/0006_player_icon_name.py | JaliJuhola/tasks-around-tampere | 87853210187764fc7cfcf89397256efbcd324c09 | [
"MIT"
] | null | null | null | tasks-around-university/rest/maingame/migrations/0006_player_icon_name.py | JaliJuhola/tasks-around-tampere | 87853210187764fc7cfcf89397256efbcd324c09 | [
"MIT"
] | 2 | 2020-06-05T19:08:46.000Z | 2021-06-10T20:51:31.000Z | tasks-around-university/rest/maingame/migrations/0006_player_icon_name.py | JaliJuhola/tasks-around-tampere | 87853210187764fc7cfcf89397256efbcd324c09 | [
"MIT"
] | 1 | 2019-02-18T08:58:04.000Z | 2019-02-18T08:58:04.000Z | # Generated by Django 2.0.1 on 2019-01-02 10:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('maingame', '0005_lobby_lobbyplayer'),
]
operations = [
migrations.AddField(
model_name='player',
name='icon_name',
... | 21.684211 | 75 | 0.609223 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('maingame', '0005_lobby_lobbyplayer'),
]
operations = [
migrations.AddField(
model_name='player',
name='icon_name',
field=models.CharField(default='spac... | true | true |
f743abe2d939c529439c578ded5d35a4376b60d0 | 4,641 | py | Python | py/trash/005-2_agg_each_lgb_1.py | KazukiOnodera/Microsoft-Malware-Prediction | 103cbf7c4fc98ae584e1aa9d1c220bb79ddbbd80 | [
"MIT"
] | 24 | 2019-03-14T05:03:16.000Z | 2021-07-16T05:14:05.000Z | py/trash/005-2_agg_each_lgb_1.py | xwc940512/Microsoft-Malware-Prediction | 103cbf7c4fc98ae584e1aa9d1c220bb79ddbbd80 | [
"MIT"
] | 1 | 2019-05-20T10:06:33.000Z | 2019-05-20T10:06:33.000Z | py/trash/005-2_agg_each_lgb_1.py | xwc940512/Microsoft-Malware-Prediction | 103cbf7c4fc98ae584e1aa9d1c220bb79ddbbd80 | [
"MIT"
] | 8 | 2019-03-14T06:28:38.000Z | 2019-05-21T14:58:21.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Feb 5 22:33:48 2019
@author: Kazuki
"""
import numpy as np
import pandas as pd
import os, gc
from glob import glob
from tqdm import tqdm
import sys
sys.path.append(f'/home/{os.environ.get("USER")}/PythonLibrary')
import lgbextension as ex
import ligh... | 25.927374 | 110 | 0.536953 |
import numpy as np
import pandas as pd
import os, gc
from glob import glob
from tqdm import tqdm
import sys
sys.path.append(f'/home/{os.environ.get("USER")}/PythonLibrary')
import lgbextension as ex
import lightgbm as lgb
from multiprocessing import cpu_count
from sklearn.metrics import roc_auc_score
import utils... | true | true |
f743ac033db6f9abb2765e58c2f56da29f5e29d0 | 926 | py | Python | tests/web/options/test_reqargs.py | ravila4/biothings.api | 7c03d9abc172fe54697af39d78b96711b2c590a1 | [
"Apache-2.0"
] | 30 | 2017-07-23T14:50:29.000Z | 2022-02-08T08:08:16.000Z | tests/web/options/test_reqargs.py | ravila4/biothings.api | 7c03d9abc172fe54697af39d78b96711b2c590a1 | [
"Apache-2.0"
] | 163 | 2017-10-24T18:45:40.000Z | 2022-03-28T03:46:26.000Z | tests/web/options/test_reqargs.py | ravila4/biothings.api | 7c03d9abc172fe54697af39d78b96711b2c590a1 | [
"Apache-2.0"
] | 22 | 2017-06-12T18:30:15.000Z | 2022-03-01T18:10:47.000Z | from biothings.web.options import ReqArgs
def test_01():
assert str(ReqArgs(
query={
"format": "yaml",
"size": "1002"},
json_={
"q": "cdk2",
"scopes": ["ensembl", "entrez"],
"format": "json"}
)).replace(" ", "") == """
ReqArgs... | 28.060606 | 78 | 0.446004 | from biothings.web.options import ReqArgs
def test_01():
assert str(ReqArgs(
query={
"format": "yaml",
"size": "1002"},
json_={
"q": "cdk2",
"scopes": ["ensembl", "entrez"],
"format": "json"}
)).replace(" ", "") == """
ReqArgs... | true | true |
f743ac9708692924df42ff55d6eb44c932ce550f | 21,447 | py | Python | tedi/kernels.py | jdavidrcamacho/tedi | f963e781e0a3c7be3df338a85a08ab974b6b8019 | [
"MIT"
] | 1 | 2021-06-26T16:17:51.000Z | 2021-06-26T16:17:51.000Z | tedi/kernels.py | jdavidrcamacho/tedi | f963e781e0a3c7be3df338a85a08ab974b6b8019 | [
"MIT"
] | 3 | 2018-11-29T16:37:34.000Z | 2020-06-30T13:41:24.000Z | tedi/kernels.py | jdavidrcamacho/tedi | f963e781e0a3c7be3df338a85a08ab974b6b8019 | [
"MIT"
] | null | null | null | """
Covariance functions
"""
import numpy as np
#because it makes life easier down the line
pi, exp, sine, cosine, sqrt = np.pi, np.exp, np.sin, np.cos, np.sqrt
__all__ = ['Constant', 'WhiteNoise', 'SquaredExponential' , 'Periodic',
'QuasiPeriodic', 'RationalQuadratic', 'Cosine', 'Exponential',
... | 31.586156 | 92 | 0.555509 | import numpy as np
pi, exp, sine, cosine, sqrt = np.pi, np.exp, np.sin, np.cos, np.sqrt
__all__ = ['Constant', 'WhiteNoise', 'SquaredExponential' , 'Periodic',
'QuasiPeriodic', 'RationalQuadratic', 'Cosine', 'Exponential',
'Matern32', 'Matern52', 'RQP']
class kernel(object):
def __init__... | true | true |
f743acf081634228426c0417e6614545867bd134 | 2,162 | py | Python | tests/python/gaia-ui-tests/gaiatest/tests/functional/browser/test_browser_play_youtube_video.py | dcoloma/gaia | e542540cfa64c31ac8bb71b1a9cf16879fc9d58e | [
"Apache-2.0"
] | 1 | 2017-09-09T12:55:56.000Z | 2017-09-09T12:55:56.000Z | tests/python/gaia-ui-tests/gaiatest/tests/functional/browser/test_browser_play_youtube_video.py | AmyYLee/gaia | a5dbae8235163d7f985bdeb7d649268f02749a8b | [
"Apache-2.0"
] | 1 | 2021-11-01T18:29:16.000Z | 2021-11-01T18:29:16.000Z | tests/python/gaia-ui-tests/gaiatest/tests/functional/browser/test_browser_play_youtube_video.py | AmyYLee/gaia | a5dbae8235163d7f985bdeb7d649268f02749a8b | [
"Apache-2.0"
] | 1 | 2021-08-20T11:26:36.000Z | 2021-08-20T11:26:36.000Z | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from marionette.by import By
from gaiatest import GaiaTestCase
from gaiatest.apps.browser.app import Browser
from gaiate... | 34.870968 | 88 | 0.689639 |
from marionette.by import By
from gaiatest import GaiaTestCase
from gaiatest.apps.browser.app import Browser
from gaiatest.apps.browser.regions.html5_player import HTML5Player
class TestYouTube(GaiaTestCase):
video_URL = 'http://m.youtube.com/watch?v=5MzuGWFIfio'
acceptable_delay = 2.0
_video_c... | true | true |
f743ad2591f438289017ac5bf4aeed1b0b1d615c | 274 | py | Python | Deposit Calculator.py | GYosifov88/Python-Basics | f4290061264aebc417bde4948948e4a64739fec9 | [
"MIT"
] | null | null | null | Deposit Calculator.py | GYosifov88/Python-Basics | f4290061264aebc417bde4948948e4a64739fec9 | [
"MIT"
] | null | null | null | Deposit Calculator.py | GYosifov88/Python-Basics | f4290061264aebc417bde4948948e4a64739fec9 | [
"MIT"
] | null | null | null | deposit = float(input())
term_of_deposit = int(input())
interest_percent = float(input())
interest_accumulated = deposit * interest_percent / 100
interest_per_month = interest_accumulated / 12
total_amount = deposit + term_of_deposit * interest_per_month
print(total_amount) | 39.142857 | 61 | 0.806569 | deposit = float(input())
term_of_deposit = int(input())
interest_percent = float(input())
interest_accumulated = deposit * interest_percent / 100
interest_per_month = interest_accumulated / 12
total_amount = deposit + term_of_deposit * interest_per_month
print(total_amount) | true | true |
f743ad82c2a4eea20954a6ea1760ad7c53823fc3 | 2,091 | py | Python | train_with_your_data/scripts/cpmg/pathologic_classification/control_tumor/raw_spectrum/cropped/RF/config.py | ciceklab/targeted_brain_tumor_margin_assessment | 2cf729019dfc1785992208a69c353a659c9b6448 | [
"MIT"
] | 1 | 2021-12-11T20:06:39.000Z | 2021-12-11T20:06:39.000Z | train_with_your_data/scripts/cpmg/pathologic_classification/control_tumor/raw_spectrum/cropped/RF/config.py | ciceklab/targeted_brain_tumor_margin_assessment | 2cf729019dfc1785992208a69c353a659c9b6448 | [
"MIT"
] | null | null | null | train_with_your_data/scripts/cpmg/pathologic_classification/control_tumor/raw_spectrum/cropped/RF/config.py | ciceklab/targeted_brain_tumor_margin_assessment | 2cf729019dfc1785992208a69c353a659c9b6448 | [
"MIT"
] | 2 | 2021-12-15T18:17:17.000Z | 2021-12-16T12:08:30.000Z | import os
import sys
import pandas as pd
import numpy as np
import pdb
import torch
import torch.nn as nn
import torch.nn.functional as F
sys.path.insert(1,"../")
sys.path.insert(1,"../../")
sys.path.insert(1,"../../../")
sys.path.insert(1,"../../../../")
sys.path.insert(1,"../../../../../")
sys.path.ins... | 36.051724 | 167 | 0.709708 | import os
import sys
import pandas as pd
import numpy as np
import pdb
import torch
import torch.nn as nn
import torch.nn.functional as F
sys.path.insert(1,"../")
sys.path.insert(1,"../../")
sys.path.insert(1,"../../../")
sys.path.insert(1,"../../../../")
sys.path.insert(1,"../../../../../")
sys.path.ins... | true | true |
f743add48538ea59368df7cf057345e5a9e9d117 | 2,275 | py | Python | code/processing/growth_rates/2021-07-27_r2_SingleKO_acetate/analysis.py | cremerlab/useless_expression | a6020674f0ae73b4cc6173de60a0ea93016ee562 | [
"MIT"
] | null | null | null | code/processing/growth_rates/2021-07-27_r2_SingleKO_acetate/analysis.py | cremerlab/useless_expression | a6020674f0ae73b4cc6173de60a0ea93016ee562 | [
"MIT"
] | null | null | null | code/processing/growth_rates/2021-07-27_r2_SingleKO_acetate/analysis.py | cremerlab/useless_expression | a6020674f0ae73b4cc6173de60a0ea93016ee562 | [
"MIT"
] | null | null | null | #%%
import numpy as np
import pandas as pd
import futileprot.viz
import altair as alt
import altair_saver
import scipy.stats
colors, palette = futileprot.viz.altair_style()
# Add metadata
DATE = '2021-07-27'
RUN_NO = 2
STRAINS = 'SingleKO'
MEDIUM = 'acetate'
# Load the measurement data
data = pd.read_csv(f'./output... | 32.971014 | 89 | 0.551648 |
import numpy as np
import pandas as pd
import futileprot.viz
import altair as alt
import altair_saver
import scipy.stats
colors, palette = futileprot.viz.altair_style()
DATE = '2021-07-27'
RUN_NO = 2
STRAINS = 'SingleKO'
MEDIUM = 'acetate'
data = pd.read_csv(f'./output/{DATE}_r{RUN_NO}_{STRAINS}_{MEDIUM}_exponen... | true | true |
f743ae39ba5f30a2ab7d0a7d2f187e9ff85b846c | 3,854 | py | Python | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt_acs/lib/models/deployment_properties_extended.py | enterstudio/azure-cli | b0504c3b634e17f1afc944a9572864a40da6bc18 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt_acs/lib/models/deployment_properties_extended.py | enterstudio/azure-cli | b0504c3b634e17f1afc944a9572864a40da6bc18 | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-vm/azure/cli/command_modules/vm/mgmt_acs/lib/models/deployment_properties_extended.py | enterstudio/azure-cli | b0504c3b634e17f1afc944a9572864a40da6bc18 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 48.78481 | 219 | 0.633368 |
from msrest.serialization import Model
class DeploymentPropertiesExtended(Model):
_attribute_map = {
'provisioning_state': {'key': 'provisioningState', 'type': 'str'},
'correlation_id': {'key': 'correlationId', 'type': 'str'},
'timestamp': {'key': 'timestamp', 'type': 'iso-86... | true | true |
f743aec5b6157ef8b21d56df7106f118da53c1f5 | 2,699 | py | Python | experiments/vitchyr/nips2018/old/sawyer_push/her_td3.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/vitchyr/nips2018/old/sawyer_push/her_td3.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/vitchyr/nips2018/old/sawyer_push/her_td3.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | import railrl.misc.hyperparameter as hyp
from railrl.data_management.her_replay_buffer import RelabelingReplayBuffer
from railrl.envs.mujoco.sawyer_push_env import SawyerPushXYEnv, \
SawyerPushXYEasyEnv
from railrl.launchers.experiments.vitchyr.multitask import her_td3_experiment
from railrl.launchers.launcher_util... | 29.336957 | 96 | 0.565024 | import railrl.misc.hyperparameter as hyp
from railrl.data_management.her_replay_buffer import RelabelingReplayBuffer
from railrl.envs.mujoco.sawyer_push_env import SawyerPushXYEnv, \
SawyerPushXYEasyEnv
from railrl.launchers.experiments.vitchyr.multitask import her_td3_experiment
from railrl.launchers.launcher_util... | true | true |
f743aed7fe5059ec952f7fc62a1008bddc28efe3 | 27,479 | py | Python | flair/embeddings/document.py | aynetdia/flair | 7e0958423ceb9744a87b0c27fd66f7be4caf0d99 | [
"MIT"
] | null | null | null | flair/embeddings/document.py | aynetdia/flair | 7e0958423ceb9744a87b0c27fd66f7be4caf0d99 | [
"MIT"
] | 1 | 2021-03-01T17:14:03.000Z | 2021-03-01T17:14:03.000Z | flair/embeddings/document.py | aynetdia/flair | 7e0958423ceb9744a87b0c27fd66f7be4caf0d99 | [
"MIT"
] | 2 | 2021-02-24T19:58:46.000Z | 2021-02-25T10:53:23.000Z | from abc import abstractmethod
import logging
from typing import List, Union
import torch
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from transformers import AutoTokenizer, AutoConfig, AutoModel, CONFIG_MAPPING, PreTrainedTokenizer
import flair
from flair.data import Sentence
from flair.... | 39.767004 | 131 | 0.628152 | from abc import abstractmethod
import logging
from typing import List, Union
import torch
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
from transformers import AutoTokenizer, AutoConfig, AutoModel, CONFIG_MAPPING, PreTrainedTokenizer
import flair
from flair.data import Sentence
from flair.... | true | true |
f743b17e06a529fa4281bdedbb5f6d9cf7051e84 | 30,380 | py | Python | code/embed_and_filter.py | Penn-TopGuNN/TopGuNN | e736e467f1991a33c5ee54407665cbd9fef1e521 | [
"MIT"
] | 5 | 2021-06-11T21:55:29.000Z | 2021-12-08T23:16:40.000Z | code/embed_and_filter.py | Penn-TopGuNN/TopGuNN | e736e467f1991a33c5ee54407665cbd9fef1e521 | [
"MIT"
] | null | null | null | code/embed_and_filter.py | Penn-TopGuNN/TopGuNN | e736e467f1991a33c5ee54407665cbd9fef1e521 | [
"MIT"
] | 1 | 2021-08-24T19:36:44.000Z | 2021-08-24T19:36:44.000Z | import numpy as np
import torch
from transformers import BertTokenizer, BertModel
from torch.utils.data import DataLoader
import util
from util import MaskableList
from collections import defaultdict, Counter
from sentence_transformers import SentenceTransformer
import spacy
import time
import itertools
from itertools... | 49.158576 | 221 | 0.670408 | import numpy as np
import torch
from transformers import BertTokenizer, BertModel
from torch.utils.data import DataLoader
import util
from util import MaskableList
from collections import defaultdict, Counter
from sentence_transformers import SentenceTransformer
import spacy
import time
import itertools
from itertools... | true | true |
f743b181b6338d02485d7c25a7937e029ff4d518 | 100 | py | Python | neurokit/statistics/__init__.py | ucohen/NeuroKit.py | 0196fc7cfbf22b499eec51036b3eb492a2893014 | [
"MIT"
] | 338 | 2017-03-28T17:36:18.000Z | 2022-03-25T00:58:56.000Z | neurokit/statistics/__init__.py | ucohen/NeuroKit.py | 0196fc7cfbf22b499eec51036b3eb492a2893014 | [
"MIT"
] | 108 | 2017-04-25T12:27:30.000Z | 2021-02-08T21:52:38.000Z | neurokit/statistics/__init__.py | ucohen/NeuroKit.py | 0196fc7cfbf22b499eec51036b3eb492a2893014 | [
"MIT"
] | 108 | 2016-12-11T15:41:08.000Z | 2022-03-25T00:59:00.000Z | """
statistics submodule.
"""
from .statistics import *
from .plot import *
from .routines import * | 14.285714 | 25 | 0.71 |
from .statistics import *
from .plot import *
from .routines import * | true | true |
f743b3c95ad57c230459c1a942a79634d61aa140 | 809 | py | Python | LHD Build Sort a list.py | Ananya2003Gupta/LHD-Build-Sort-a-list | e611f39024d05644603a1102990528c5e8bb481b | [
"MIT"
] | 1 | 2022-01-15T13:54:33.000Z | 2022-01-15T13:54:33.000Z | LHD Build Sort a list.py | Ananya2003Gupta/LHD-Build-Sort-a-list | e611f39024d05644603a1102990528c5e8bb481b | [
"MIT"
] | null | null | null | LHD Build Sort a list.py | Ananya2003Gupta/LHD-Build-Sort-a-list | e611f39024d05644603a1102990528c5e8bb481b | [
"MIT"
] | null | null | null | # Shortest Menu driven program possible :)
def asc(l):
print("List in ascending order:",sorted(l)) #returns list in ascending order
def desc(l):
print("List in descending order:",sorted(l)[::-1]) # returns the reverse of the ascending ordered list
def menu():
while True:
print("""MENU :
1.Sort lis... | 28.892857 | 106 | 0.546354 |
def asc(l):
print("List in ascending order:",sorted(l))
def desc(l):
print("List in descending order:",sorted(l)[::-1])
def menu():
while True:
print("""MENU :
1.Sort list in Ascending order
2.Sort list in Descending order
3.Exit""")
c=int(input("Enter your choice:"))
if c==3:
... | true | true |
f743b3d01d8e06b228b29b374042094d92dacbbf | 519 | py | Python | tests/rules/test_python_execute.py | eoinjordan/thefeck | e04f50409ba3069ec6a9f7c0aab39ca835a41b68 | [
"MIT"
] | null | null | null | tests/rules/test_python_execute.py | eoinjordan/thefeck | e04f50409ba3069ec6a9f7c0aab39ca835a41b68 | [
"MIT"
] | null | null | null | tests/rules/test_python_execute.py | eoinjordan/thefeck | e04f50409ba3069ec6a9f7c0aab39ca835a41b68 | [
"MIT"
] | null | null | null | import pytest
from thefeck.rules.python_execute import match, get_new_command
from thefeck.types import Command
@pytest.mark.parametrize('command', [
Command('python bar', ''),
Command('python bar', '')])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command, new_command', [
... | 28.833333 | 63 | 0.709056 | import pytest
from thefeck.rules.python_execute import match, get_new_command
from thefeck.types import Command
@pytest.mark.parametrize('command', [
Command('python bar', ''),
Command('python bar', '')])
def test_match(command):
assert match(command)
@pytest.mark.parametrize('command, new_command', [
... | true | true |
f743b48f92241bc76f6ef5cee53715351535803b | 21,670 | py | Python | google/devtools/clouddebugger/v2/devtools-clouddebugger-v2-py/google/cloud/debugger_v2/types/data.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/devtools/clouddebugger/v2/devtools-clouddebugger-v2-py/google/cloud/debugger_v2/types/data.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/devtools/clouddebugger/v2/devtools-clouddebugger-v2-py/google/cloud/debugger_v2/types/data.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 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... | 34.018838 | 117 | 0.612413 |
import proto
from google.devtools.source.v1 import source_context_pb2
from google.protobuf import timestamp_pb2
from google.protobuf import wrappers_pb2
__protobuf__ = proto.module(
package='google.devtools.clouddebugger.v2',
manifest={
'FormatMessage',
'StatusMessage',... | true | true |
f743b49a55885cd5c9cebb6410b29970d84e54d8 | 90 | py | Python | retinanet/model/backbone/__init__.py | lchen-wyze/retinanet-tensorflow2.x | 86404a2da6ec636d4b1aef768ac52f018c127798 | [
"Apache-2.0"
] | 36 | 2020-09-23T13:32:47.000Z | 2022-03-29T18:53:58.000Z | retinanet/model/backbone/__init__.py | lchen-wyze/retinanet-tensorflow2.x | 86404a2da6ec636d4b1aef768ac52f018c127798 | [
"Apache-2.0"
] | 12 | 2020-10-25T09:07:58.000Z | 2021-11-17T12:53:50.000Z | retinanet/model/backbone/__init__.py | lchen-wyze/retinanet-tensorflow2.x | 86404a2da6ec636d4b1aef768ac52f018c127798 | [
"Apache-2.0"
] | 9 | 2020-11-12T20:03:06.000Z | 2022-01-03T12:40:48.000Z | from retinanet.model.backbone.builder import build_backbone
__all__ = ['build_backbone']
| 22.5 | 59 | 0.822222 | from retinanet.model.backbone.builder import build_backbone
__all__ = ['build_backbone']
| true | true |
f743b6ad712f5fb2cd499b949bae92085852c671 | 2,320 | py | Python | Analysis/Precision-Recall_Analysis/scripts/add_tp_seqs.py | dantaslab/resfams_update | 982091818a299d316811fe98c7656762be7284fb | [
"MIT"
] | null | null | null | Analysis/Precision-Recall_Analysis/scripts/add_tp_seqs.py | dantaslab/resfams_update | 982091818a299d316811fe98c7656762be7284fb | [
"MIT"
] | null | null | null | Analysis/Precision-Recall_Analysis/scripts/add_tp_seqs.py | dantaslab/resfams_update | 982091818a299d316811fe98c7656762be7284fb | [
"MIT"
] | null | null | null | import sys
import os
import pandas as pd
import csv
import argparse
from collections import OrderedDict
from io import StringIO
def main(argv):
args = parse_arguments(argv)
out = args.out_path
file1 = args.file1
file2 = args.file2
file3 = args.file3
ddf1 = addSeqs(file1,file2)
ddf2 = rem... | 20.900901 | 94 | 0.537931 | import sys
import os
import pandas as pd
import csv
import argparse
from collections import OrderedDict
from io import StringIO
def main(argv):
args = parse_arguments(argv)
out = args.out_path
file1 = args.file1
file2 = args.file2
file3 = args.file3
ddf1 = addSeqs(file1,file2)
ddf2 = rem... | true | true |
f743b78f29621de28b75a932b01c19e6437ec292 | 701 | py | Python | mars/tensor/stats/core.py | mimeku/mars | 322c187842a0ca99cea2a5f311d10e681969bd78 | [
"Apache-2.0"
] | null | null | null | mars/tensor/stats/core.py | mimeku/mars | 322c187842a0ca99cea2a5f311d10e681969bd78 | [
"Apache-2.0"
] | null | null | null | mars/tensor/stats/core.py | mimeku/mars | 322c187842a0ca99cea2a5f311d10e681969bd78 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 36.894737 | 74 | 0.763195 |
from collections import namedtuple
KstestResult = namedtuple('KstestResult', ('statistic', 'pvalue'))
| true | true |
f743b881beb0540a24b998b4e407da40d3979c1b | 25,286 | py | Python | frappe/model/base_document.py | Austinb/frappe | 9c096a749610115569eec9c5f3946e9e55b95514 | [
"MIT"
] | null | null | null | frappe/model/base_document.py | Austinb/frappe | 9c096a749610115569eec9c5f3946e9e55b95514 | [
"MIT"
] | null | null | null | frappe/model/base_document.py | Austinb/frappe | 9c096a749610115569eec9c5f3946e9e55b95514 | [
"MIT"
] | 1 | 2019-10-01T07:32:09.000Z | 2019-10-01T07:32:09.000Z | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
from six import iteritems, string_types
import datetime
import frappe, sys
from frappe import _
from frappe.utils import (cint, flt, now, cstr, strip_html, getdate, get_datetime, ... | 30.46506 | 120 | 0.685636 |
from __future__ import unicode_literals
from six import iteritems, string_types
import datetime
import frappe, sys
from frappe import _
from frappe.utils import (cint, flt, now, cstr, strip_html, getdate, get_datetime, to_timedelta,
sanitize_html, sanitize_email)
from frappe.model import default_fields
from frappe.... | true | true |
f743b8bc1dc0a5166867979f4568978893cd2167 | 6,069 | py | Python | ghost/core/base/device.py | houssambop/Ghost | 5aa3efa31b5eeb0d3342ab463a25423101ba8e00 | [
"MIT"
] | 1 | 2021-08-30T05:41:45.000Z | 2021-08-30T05:41:45.000Z | ghost/core/base/device.py | houssambop/Ghost | 5aa3efa31b5eeb0d3342ab463a25423101ba8e00 | [
"MIT"
] | null | null | null | ghost/core/base/device.py | houssambop/Ghost | 5aa3efa31b5eeb0d3342ab463a25423101ba8e00 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020 EntySec
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use,... | 37.93125 | 112 | 0.568298 |
from adb_shell.adb_device import AdbDeviceTcp
from ghost.core.cli.badges import Badges
from ghost.core.cli.tables import Tables
from ghost.core.cli.colors import Colors
from ghost.core.base.loader import Loader
class Device:
def __init__(self, host, port=5555, timeout=10):
self.... | true | true |
f743b8bcbc4967197c22704f9c4102ed4d29d69d | 5,944 | py | Python | tests/contrib/pytest/test_pytest.py | ClementAcher/dd-trace-py | f36519313c64d912ab9010094205ec3a82f1e493 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/contrib/pytest/test_pytest.py | ClementAcher/dd-trace-py | f36519313c64d912ab9010094205ec3a82f1e493 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | tests/contrib/pytest/test_pytest.py | ClementAcher/dd-trace-py | f36519313c64d912ab9010094205ec3a82f1e493 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | import os
import pytest
from ddtrace import Pin
from ddtrace.ext import test
from ... import TracerTestCase
class TestPytest(TracerTestCase):
@pytest.fixture(autouse=True)
def fixtures(self, testdir, monkeypatch):
self.testdir = testdir
self.monkeypatch = monkeypatch
def inline_run(sel... | 31.284211 | 98 | 0.563425 | import os
import pytest
from ddtrace import Pin
from ddtrace.ext import test
from ... import TracerTestCase
class TestPytest(TracerTestCase):
@pytest.fixture(autouse=True)
def fixtures(self, testdir, monkeypatch):
self.testdir = testdir
self.monkeypatch = monkeypatch
def inline_run(sel... | true | true |
f743b941657c5f3e4c913c7ba06de66c2347ac6e | 4,012 | py | Python | Datasets/Terrain/us_ned_mtpi.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | 1 | 2020-05-31T14:19:59.000Z | 2020-05-31T14:19:59.000Z | Datasets/Terrain/us_ned_mtpi.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | null | null | null | Datasets/Terrain/us_ned_mtpi.py | c11/earthengine-py-notebooks | 144b57e4d952da095ba73c3cc8ce2f36291162ff | [
"MIT"
] | null | null | null | # %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Datasets/Terrain/us_ned_mtpi.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target=... | 49.530864 | 1,021 | 0.741775 |
import subprocess
try:
import geemap
except ImportError:
print('geemap package not installed. Installing ...')
subprocess.check_call(["python", '-m', 'pip', 'install', 'geemap'])
try:
import google.colab
import geemap.eefolium as emap
except:
import geemap as emap
import ee
try:
... | true | true |
f743b9c07354f5c2f9fa0aee2bcab50a14abbd00 | 2,589 | py | Python | src/lyxnotebook/run_lyxnotebook.py | abarker/lyxNotebook | c458b21e1b183b94172414e14dea671e1f3d4b22 | [
"MIT"
] | 12 | 2015-07-16T13:39:04.000Z | 2022-02-14T15:36:10.000Z | src/lyxnotebook/run_lyxnotebook.py | abarker/lyxNotebook | c458b21e1b183b94172414e14dea671e1f3d4b22 | [
"MIT"
] | 4 | 2020-03-11T00:33:50.000Z | 2020-05-21T22:05:13.000Z | src/lyxnotebook/run_lyxnotebook.py | abarker/lyxNotebook | c458b21e1b183b94172414e14dea671e1f3d4b22 | [
"MIT"
] | 3 | 2015-07-16T13:39:06.000Z | 2020-04-15T19:17:45.000Z | #! /usr/bin/python
"""
=========================================================================
This file is part of LyX Notebook, which works with LyX but is an
independent project. License details (MIT) can be found in the file
COPYING.
Copyright (c) 2012 Allen Barker
=============================================... | 36.464789 | 86 | 0.631904 |
import os
import sys
import time
from .config_file_processing import config_dict
from .controller_of_lyx_and_interpreters import ControllerOfLyxAndInterpreters
from . import gui
lyx_user_directory = config_dict["lyx_user_directory"]
lockfile_path = os.path.abspath(os.path.expanduser(
os.path.join(... | true | true |
f743b9e6785ef1c3eb6d4d478a957b4edbd4b056 | 7,766 | py | Python | kolibri/core/auth/permissions/auth.py | Evgeni998/kolibri | 98bb185b73b247c0e774b229dd507fa6e74c4eaf | [
"MIT"
] | null | null | null | kolibri/core/auth/permissions/auth.py | Evgeni998/kolibri | 98bb185b73b247c0e774b229dd507fa6e74c4eaf | [
"MIT"
] | 8 | 2021-05-21T15:31:24.000Z | 2022-02-24T15:02:14.000Z | kolibri/core/auth/permissions/auth.py | kuboginichimaru/kolibri | 18b398f62baa1c60f8456f7f9c6d6c9447068f69 | [
"MIT"
] | 4 | 2021-11-15T04:23:34.000Z | 2021-11-25T16:40:11.000Z | """
The permissions classes in this module define the specific permissions that govern access to the models in the auth app.
"""
from django.contrib.auth.models import AnonymousUser
from django.db.models import Q
from ..constants.collection_kinds import ADHOCLEARNERSGROUP
from ..constants.collection_kinds import FACIL... | 34.825112 | 127 | 0.691347 | from django.contrib.auth.models import AnonymousUser
from django.db.models import Q
from ..constants.collection_kinds import ADHOCLEARNERSGROUP
from ..constants.collection_kinds import FACILITY
from ..constants.collection_kinds import LEARNERGROUP
from ..constants.role_kinds import ADMIN
from ..constants.role_kinds im... | true | true |
f743ba9caa559c0d7b6dde6b035e5acc38b67e47 | 2,350 | py | Python | metpy/io/tests/test_io_tools.py | mendezr/MetPy | 0c75c14ac4af360b06ed7c4735b17709caef2449 | [
"BSD-3-Clause"
] | null | null | null | metpy/io/tests/test_io_tools.py | mendezr/MetPy | 0c75c14ac4af360b06ed7c4735b17709caef2449 | [
"BSD-3-Clause"
] | null | null | null | metpy/io/tests/test_io_tools.py | mendezr/MetPy | 0c75c14ac4af360b06ed7c4735b17709caef2449 | [
"BSD-3-Clause"
] | 1 | 2019-07-24T02:52:05.000Z | 2019-07-24T02:52:05.000Z | # Copyright (c) 2016 MetPy Developers.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Test the `io.tools` module."""
import numpy as np
import pytest
from metpy.io._tools import hexdump, UnitLinker
from metpy.io.cdm import Dataset
from metpy.testing import assert... | 29.375 | 80 | 0.697021 |
import numpy as np
import pytest
from metpy.io._tools import hexdump, UnitLinker
from metpy.io.cdm import Dataset
from metpy.testing import assert_array_equal, ignore_deprecation
from metpy.units import units
@pytest.fixture()
@ignore_deprecation
def test_var():
ds = Dataset()
ds.createDimension('x', 5)
... | true | true |
f743baaf25e01a5af95c2356e2f179b65bf83d89 | 475 | py | Python | blog/blog/base_admin.py | drunkwretch/python_learning | a9921cf0e5d27937f56208a5101410b1a3cace91 | [
"MIT"
] | null | null | null | blog/blog/base_admin.py | drunkwretch/python_learning | a9921cf0e5d27937f56208a5101410b1a3cace91 | [
"MIT"
] | null | null | null | blog/blog/base_admin.py | drunkwretch/python_learning | a9921cf0e5d27937f56208a5101410b1a3cace91 | [
"MIT"
] | null | null | null | from django.contrib import admin
class BaseOwnerAdmin(admin.ModelAdmin):
"""
自动补充owner字段
用来针对queryset过滤当前用户的数据
"""
exclude = ('owner',)
def get_queryset(self, request):
qs = super(BaseOwnerAdmin, self).get_queryset(request)
return qs.filter(owner=request.user)
def save_m... | 25 | 81 | 0.675789 | from django.contrib import admin
class BaseOwnerAdmin(admin.ModelAdmin):
exclude = ('owner',)
def get_queryset(self, request):
qs = super(BaseOwnerAdmin, self).get_queryset(request)
return qs.filter(owner=request.user)
def save_model(self, request, obj, form, change):
obj.owner ... | true | true |
f743bcd58d973e63c4a15c53633ff87895a7e899 | 2,122 | py | Python | conans/client/uploader.py | TyRoXx/conan | 644516b5126f78f46275a9f6a01148183c9d149f | [
"MIT"
] | null | null | null | conans/client/uploader.py | TyRoXx/conan | 644516b5126f78f46275a9f6a01148183c9d149f | [
"MIT"
] | null | null | null | conans/client/uploader.py | TyRoXx/conan | 644516b5126f78f46275a9f6a01148183c9d149f | [
"MIT"
] | null | null | null | import os
from conans.errors import ConanException, NotFoundException
from conans.model.ref import PackageReference
class ConanUploader(object):
def __init__(self, paths, user_io, remote_manager, remote):
self._paths = paths
self._user_io = user_io
self._remote_manager = remote_manager
... | 42.44 | 98 | 0.640905 | import os
from conans.errors import ConanException, NotFoundException
from conans.model.ref import PackageReference
class ConanUploader(object):
def __init__(self, paths, user_io, remote_manager, remote):
self._paths = paths
self._user_io = user_io
self._remote_manager = remote_manager
... | true | true |
f743bdc1b43a2e91844dc402bb7342499427d73e | 5,023 | py | Python | mayan/apps/storage/tests/test_utils.py | bonitobonita24/Mayan-EDMS | 7845fe0e1e83c81f5d227a16116397a3d3883b85 | [
"Apache-2.0"
] | 343 | 2015-01-05T14:19:35.000Z | 2018-12-10T19:07:48.000Z | mayan/apps/storage/tests/test_utils.py | bonitobonita24/Mayan-EDMS | 7845fe0e1e83c81f5d227a16116397a3d3883b85 | [
"Apache-2.0"
] | 191 | 2015-01-03T00:48:19.000Z | 2018-11-30T09:10:25.000Z | mayan/apps/storage/tests/test_utils.py | bonitobonita24/Mayan-EDMS | 7845fe0e1e83c81f5d227a16116397a3d3883b85 | [
"Apache-2.0"
] | 114 | 2015-01-08T20:21:05.000Z | 2018-12-10T19:07:53.000Z | from pathlib import Path
import shutil
from django.utils.encoding import force_text
from mayan.apps.documents.storages import storage_document_files
from mayan.apps.documents.tests.base import GenericDocumentTestCase
from mayan.apps.mime_types.tests.mixins import MIMETypeBackendMixin
from mayan.apps.testing.tests.bas... | 33.046053 | 122 | 0.649015 | from pathlib import Path
import shutil
from django.utils.encoding import force_text
from mayan.apps.documents.storages import storage_document_files
from mayan.apps.documents.tests.base import GenericDocumentTestCase
from mayan.apps.mime_types.tests.mixins import MIMETypeBackendMixin
from mayan.apps.testing.tests.bas... | true | true |
f743bf1a51d065f33ce9e08bd09942aab86552c7 | 3,412 | py | Python | L1Trigger/CSCTriggerPrimitives/test/runCSCL1TDQMClient_cfg.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | L1Trigger/CSCTriggerPrimitives/test/runCSCL1TDQMClient_cfg.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | L1Trigger/CSCTriggerPrimitives/test/runCSCL1TDQMClient_cfg.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.VarParsing import VarParsing
from Configuration.Eras.Era_Run3_cff import Run3
from Configuration.Eras.Era_Run2_2018_cff import Run2_2018
options = VarParsing('analysis')
options.register("run3", True, VarParsing.multiplicity.singleton, VarParsing.varTyp... | 43.189873 | 101 | 0.770809 | import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.VarParsing import VarParsing
from Configuration.Eras.Era_Run3_cff import Run3
from Configuration.Eras.Era_Run2_2018_cff import Run2_2018
options = VarParsing('analysis')
options.register("run3", True, VarParsing.multiplicity.singleton, VarParsing.varTyp... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.