hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2f0c304e54a0e9ebf9c7168144f143a2881a7cfa | 539 | py | Python | openmdao.gui/src/openmdao/gui/projdb/urls.py | OzanCKN/OpenMDAO-Framework | 05e9d4b9bc41d0ec00a7073545146c925cd33b0b | [
"Apache-2.0"
] | 3 | 2015-06-02T00:36:28.000Z | 2018-11-03T00:35:21.000Z | openmdao.gui/src/openmdao/gui/projdb/urls.py | JustinSGray/OpenMDAO-Framework | 7ebd7fda0b10fbe8a86ae938dc4f135396dd9759 | [
"Apache-2.0"
] | null | null | null | openmdao.gui/src/openmdao/gui/projdb/urls.py | JustinSGray/OpenMDAO-Framework | 7ebd7fda0b10fbe8a86ae938dc4f135396dd9759 | [
"Apache-2.0"
] | 1 | 2020-07-15T02:45:54.000Z | 2020-07-15T02:45:54.000Z | from django.conf.urls.defaults import patterns, include, url
from django.views.generic import DetailView, ListView, list_detail
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('projdb.views',
# custom views
(r'^$', 'index'),
(r'^(?P<project_id>\d+)/$', 'detail'),
... | 28.368421 | 67 | 0.588126 |
e28cbfb846483f3abca076bc8c068d7df2bd5b9f | 9,214 | py | Python | model/resnet.py | Rajneesh-Tiwari/WhaleDet | 35738658c445a35c03796fa69517f492b7870ced | [
"MIT"
] | 1 | 2019-02-16T04:41:32.000Z | 2019-02-16T04:41:32.000Z | model/resnet.py | Rajneesh-Tiwari/WhaleDet | 35738658c445a35c03796fa69517f492b7870ced | [
"MIT"
] | null | null | null | model/resnet.py | Rajneesh-Tiwari/WhaleDet | 35738658c445a35c03796fa69517f492b7870ced | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras.layers import Activation, Add, AveragePooling2D, BatchNormalization, Conv2D, Dense, Flatten, Input, MaxPool2D, ZeroPadding2D
from keras.initializers import glorot_uniform
from keras.models import Mod... | 49.805405 | 135 | 0.653137 |
a61722eedb615108a2fc67cf0544f0749a6690c7 | 661 | py | Python | chapter6/task1.py | nvnovitskiy/python_sstu_course | 5de1830eb4430349df8ab1c65a9f16f82a9b91a6 | [
"MIT"
] | null | null | null | chapter6/task1.py | nvnovitskiy/python_sstu_course | 5de1830eb4430349df8ab1c65a9f16f82a9b91a6 | [
"MIT"
] | null | null | null | chapter6/task1.py | nvnovitskiy/python_sstu_course | 5de1830eb4430349df8ab1c65a9f16f82a9b91a6 | [
"MIT"
] | null | null | null | """
Ввести три строки. Получить следующие множества:
а) множество символов, одновременно входящих в каждую из
строк;
б) множество символов, входящих хотя бы в одну из строк;
в) для каждой строки – множество символов, входящих только в
"""
str1 = set(input("Введите первую строку: "))
str2 = set(input("Введите вторую ст... | 38.882353 | 110 | 0.715582 |
fd9d9b24b49ed842a3aada6167e6b0067c1926e0 | 5,761 | py | Python | Wrappers/Python/test/test_quality_measures.py | paskino/CIL | 1803cbd445c408588fecbf705fb8b4df486029fc | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/test/test_quality_measures.py | paskino/CIL | 1803cbd445c408588fecbf705fb8b4df486029fc | [
"Apache-2.0"
] | null | null | null | Wrappers/Python/test/test_quality_measures.py | paskino/CIL | 1803cbd445c408588fecbf705fb8b4df486029fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# CCP in Tomographic Imaging (CCPi) Core Imaging Library (CIL).
# Copyright 2017 UKRI-STFC
# Copyright 2017 University of Manchester
# 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 ... | 36.232704 | 110 | 0.650581 |
74529a9dd3964ab95b14df0aff512b68622fd886 | 858 | py | Python | case_study/_2_Word Indice Construction.py | HongyiZhu/D-GEF | 64cbc9dfab7cfe4951a0f0527b8371d90eae03f8 | [
"MIT"
] | 2 | 2020-07-14T22:00:43.000Z | 2020-11-24T21:54:20.000Z | case_study/_2_Word Indice Construction.py | HongyiZhu/D-GEF | 64cbc9dfab7cfe4951a0f0527b8371d90eae03f8 | [
"MIT"
] | null | null | null | case_study/_2_Word Indice Construction.py | HongyiZhu/D-GEF | 64cbc9dfab7cfe4951a0f0527b8371d90eae03f8 | [
"MIT"
] | 2 | 2020-08-27T05:11:47.000Z | 2022-01-27T01:44:17.000Z | # -*- coding: utf-8 -*-
import networkx as nx
import pickle
from case_config import *
length = []
fullwordlist = []
for year in range(2012, 2020):
for q in range(4):
filename = "{}{}Q{}.txt".format(case, str(year), str(q + 1))
f = open(filename, 'rb')
p = pickle.load(f)
for r in p:... | 28.6 | 88 | 0.551282 |
686f1bf9876da6f1bef0a8bbd7fdd2af4deccd5b | 2,544 | py | Python | _resource/models/image/cifar10/cifar10_input.py | amlyj/tensorflowStudy | 1e3a4b15a57d53e746fd730af540da4be471c70b | [
"MIT"
] | 4 | 2021-06-11T09:43:32.000Z | 2021-11-17T11:15:52.000Z | _resource/models/image/cifar10/cifar10_input.py | amlyj/tensorflowStudy | 1e3a4b15a57d53e746fd730af540da4be471c70b | [
"MIT"
] | null | null | null | _resource/models/image/cifar10/cifar10_input.py | amlyj/tensorflowStudy | 1e3a4b15a57d53e746fd730af540da4be471c70b | [
"MIT"
] | 2 | 2015-11-13T21:11:49.000Z | 2015-11-29T04:13:49.000Z | """Routine for decoding the CIFAR-10 binary file format."""
import tensorflow.python.platform
import tensorflow as tf
def read_cifar10(filename_queue):
"""Reads and parses examples from CIFAR10 data files.
Recommendation: if you want N-way read parallelism, call this function
N times. This will give you N in... | 38.545455 | 80 | 0.718553 |
5c75b2c3d050362891efc84624b8f5bda8e39cce | 2,712 | py | Python | data.py | WillBillChiang/COVID-19Predictions | 046efcba6cf11d979ce49fc88678f03734759bc3 | [
"MIT"
] | 5 | 2020-06-02T12:20:10.000Z | 2021-04-14T12:09:37.000Z | data.py | WillBillChiang/COVID-19Predictions | 046efcba6cf11d979ce49fc88678f03734759bc3 | [
"MIT"
] | null | null | null | data.py | WillBillChiang/COVID-19Predictions | 046efcba6cf11d979ce49fc88678f03734759bc3 | [
"MIT"
] | 1 | 2020-10-05T17:59:03.000Z | 2020-10-05T17:59:03.000Z | import requests
import pandas as pd
from consts import Consts
import numpy as np
from logistic import LogisticModel
import lstm
class DataAnalyzer:
def __init__(self):
'''
Fetches data from github and sets all base variables.
Args: None
Returns: None
'''
df = pd... | 22.983051 | 116 | 0.530236 |
fa4449c74b7450eb9da1aa9a9dda61a2f3409031 | 1,786 | py | Python | distributed/diagnostics/tests/test_plugin.py | jjerphan/distributed | 0ce8f2bcb84d306e9a095d75497857dce30145b5 | [
"BSD-3-Clause"
] | null | null | null | distributed/diagnostics/tests/test_plugin.py | jjerphan/distributed | 0ce8f2bcb84d306e9a095d75497857dce30145b5 | [
"BSD-3-Clause"
] | null | null | null | distributed/diagnostics/tests/test_plugin.py | jjerphan/distributed | 0ce8f2bcb84d306e9a095d75497857dce30145b5 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division, absolute_import
from distributed import Worker
from distributed.utils_test import inc, gen_cluster
from distributed.diagnostics.plugin import SchedulerPlugin
@gen_cluster(client=True)
def test_simple(c, s, a, b):
class Counter(SchedulerPlugin):
def start(s... | 24.465753 | 66 | 0.615901 |
90ccb0acb2727a43634cbe89f39e7a2bd48d58d3 | 27,551 | py | Python | oneflow/python/nn/modules/math_ops.py | Flowingsun007/oneflow | c1880c011dd453719a28d880abe15e2dab8d0da1 | [
"Apache-2.0"
] | null | null | null | oneflow/python/nn/modules/math_ops.py | Flowingsun007/oneflow | c1880c011dd453719a28d880abe15e2dab8d0da1 | [
"Apache-2.0"
] | null | null | null | oneflow/python/nn/modules/math_ops.py | Flowingsun007/oneflow | c1880c011dd453719a28d880abe15e2dab8d0da1 | [
"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... | 27.633902 | 134 | 0.570869 |
e366c2a3a31fd5ece404858d8d9c0a763cfe0780 | 71 | py | Python | backend/wsgi.py | sksuryan/project-three | 09b52127eb00606edd7c033cd35138f05369711e | [
"MIT"
] | null | null | null | backend/wsgi.py | sksuryan/project-three | 09b52127eb00606edd7c033cd35138f05369711e | [
"MIT"
] | 4 | 2020-10-14T04:09:10.000Z | 2020-10-16T17:18:08.000Z | backend/wsgi.py | sksuryan/project-three | 09b52127eb00606edd7c033cd35138f05369711e | [
"MIT"
] | 1 | 2020-10-20T23:34:50.000Z | 2020-10-20T23:34:50.000Z | from app.app import app
if __name__=="__main__":
app.run(debug=True)
| 14.2 | 24 | 0.732394 |
ad54537623336c2a42cbc060c96245f8dd2f7f3e | 8,141 | py | Python | python/lambd.py | forember/lambd | 5550b741083e463cee60ce76bb181b4c063879a1 | [
"MIT"
] | null | null | null | python/lambd.py | forember/lambd | 5550b741083e463cee60ce76bb181b4c063879a1 | [
"MIT"
] | null | null | null | python/lambd.py | forember/lambd | 5550b741083e463cee60ce76bb181b4c063879a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: set sw=2 ts=2 sts=2 et :
import re
from collections import *
from traceback import print_exc
import random, copy, itertools
import sys
# = Syntax ===============================
class LambdaSyntaxError (Exception):
pass
# Expression Types
EXPR = 0
VAR = 1
APP... | 25.126543 | 133 | 0.549687 |
0b788ddb632b421cab12f8d0736a5656e1405786 | 2,425 | py | Python | huaweicloud-sdk-antiddos/huaweicloudsdkantiddos/v1/region/antiddos_region.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-antiddos/huaweicloudsdkantiddos/v1/region/antiddos_region.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-antiddos/huaweicloudsdkantiddos/v1/region/antiddos_region.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import types
import six
from huaweicloudsdkcore.region.region import Region
class AntiDDoSRegion:
def __init__(self):
pass
CN_NORTH_1 = Region(id="cn-north-1", endpoint="https://antiddos.cn-north-1.myhuaweicloud.com")
CN_NORTH_2 = Region(id="cn-north-2", endpoint="https://antid... | 37.890625 | 111 | 0.683711 |
27d7733c3c40351567998dd43e529cae32cd1d94 | 7,581 | py | Python | jiant/scripts/preproc/export_glue_data.py | yzpang/jiant | 192d6b525c06f33010b59044df40cb86bbfba4ea | [
"MIT"
] | 1,108 | 2019-04-22T09:19:19.000Z | 2022-03-31T13:23:51.000Z | jiant/scripts/preproc/export_glue_data.py | eric11eca/inference-information-probing | f55156201992cb024edf112e06dd2d7fe09381e4 | [
"MIT"
] | 737 | 2019-04-22T14:30:36.000Z | 2022-03-31T22:22:17.000Z | jiant/scripts/preproc/export_glue_data.py | eric11eca/inference-information-probing | f55156201992cb024edf112e06dd2d7fe09381e4 | [
"MIT"
] | 273 | 2019-04-23T01:42:11.000Z | 2022-03-25T15:59:38.000Z | import csv
import os
import tqdm
import jiant.utils.python.io as py_io
import jiant.utils.zconf as zconf
GLUE_CONVERSION = {
"cola": {
"data": {
"train": {"cols": {"text": 3, "label": 1}},
"val": {"cols": {"text": 3, "label": 1}, "meta": {"filename": "dev"}},
"test": {... | 35.425234 | 100 | 0.493471 |
aa8c0d23f13fd7f798a5886e9cbac8ebe4e77595 | 5,351 | py | Python | sfepy/base/testing.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | null | null | null | sfepy/base/testing.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | null | null | null | sfepy/base/testing.py | clazaro/sfepy | 78757a6989d6aaf85a3fb27957b9179c5e2aa2c7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import sys
import inspect
import numpy as nm
import numpy.linalg as nla
from sfepy.base.base import Struct, output, assert_
class TestCommon(Struct):
@staticmethod
def xfail(test_method):
"""
Decorator that allows a test to fail.
"""
def ... | 29.081522 | 79 | 0.493926 |
8504c52a3b93d335a83b7dd502491a1291d95dfd | 8,294 | py | Python | tests/test_dht_experts.py | mponty/hivemind | f132294edb750e95b8c1b4ff6c34064c1636f2e2 | [
"MIT"
] | null | null | null | tests/test_dht_experts.py | mponty/hivemind | f132294edb750e95b8c1b4ff6c34064c1636f2e2 | [
"MIT"
] | null | null | null | tests/test_dht_experts.py | mponty/hivemind | f132294edb750e95b8c1b4ff6c34064c1636f2e2 | [
"MIT"
] | null | null | null | import asyncio
import random
import numpy as np
import pytest
import hivemind
import hivemind.server.expert_uid
from hivemind import LOCALHOST
from hivemind.client.beam_search import MoEBeamSearcher
from hivemind.server.expert_uid import UidEndpoint, is_valid_uid, is_valid_prefix, split_uid
@pytest.mark.forked
def ... | 51.8375 | 117 | 0.663853 |
7de4601e18f49b9643434b797b33ae69b2383d45 | 5,486 | py | Python | motion_blur/blur_image.py | lindylin1817/DeblurGAN | bda91e3582a24c9a8db3f64b4ab8f9e00ac0aac7 | [
"BSD-3-Clause"
] | null | null | null | motion_blur/blur_image.py | lindylin1817/DeblurGAN | bda91e3582a24c9a8db3f64b4ab8f9e00ac0aac7 | [
"BSD-3-Clause"
] | null | null | null | motion_blur/blur_image.py | lindylin1817/DeblurGAN | bda91e3582a24c9a8db3f64b4ab8f9e00ac0aac7 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import cv2
import os
from scipy import signal
from scipy import misc
from motion_blur.generate_PSF import PSF
from motion_blur.generate_trajectory import Trajectory
class BlurImage(object):
def __init__(self, image_path, PSFs=None, part=None, path__to_save=None)... | 44.601626 | 116 | 0.554502 |
61cd63479d85e95752095dc9539700d9512e7305 | 9,902 | py | Python | Lib/test/test_future.py | jribbens/cpython | 2c5c0a367c6ca648178072240fe0a32848636da6 | [
"PSF-2.0"
] | 3 | 2020-05-07T15:44:33.000Z | 2021-11-13T15:15:55.000Z | Lib/test/test_future.py | jribbens/cpython | 2c5c0a367c6ca648178072240fe0a32848636da6 | [
"PSF-2.0"
] | 1 | 2019-10-06T22:32:10.000Z | 2020-08-01T15:22:38.000Z | Lib/test/test_future.py | jribbens/cpython | 2c5c0a367c6ca648178072240fe0a32848636da6 | [
"PSF-2.0"
] | 2 | 2021-02-14T15:20:06.000Z | 2021-11-13T15:15:58.000Z | # Test various flavors of legal and illegal future statements
from functools import partial
import unittest
from test import support
from textwrap import dedent
import os
import re
rx = re.compile(r'\((\S+).py, line (\d+)')
def get_error_location(msg):
mo = rx.search(str(msg))
return mo.group(1, 2)
class Fu... | 36.271062 | 81 | 0.531711 |
71c48224023a8a558609c406da709f3d3784fcd5 | 1,404 | py | Python | Examples/app.py | Sharonsyra/MySQLWrapperPackage | 53dd6f90b6bc25aa9a8e6ef803121208abd611f8 | [
"MIT"
] | null | null | null | Examples/app.py | Sharonsyra/MySQLWrapperPackage | 53dd6f90b6bc25aa9a8e6ef803121208abd611f8 | [
"MIT"
] | null | null | null | Examples/app.py | Sharonsyra/MySQLWrapperPackage | 53dd6f90b6bc25aa9a8e6ef803121208abd611f8 | [
"MIT"
] | null | null | null | from collections import namedtuple
import os
from wrapper import MySQLWrapper
from connections import WrapConnect
host = os.getenv('SERVER_HOST')
Table = namedtuple('Table', 'table_name datatype')
bob = Table(table_name='name', datatype='VARCHAR(23)')
jane = Table(table_name='age', datatype='VARCHAR(35)')
def tab_c... | 25.527273 | 71 | 0.682336 |
0e1e02cd345a1ca3e5ac99ed319cbfd9bb33a639 | 6,111 | py | Python | flask/lib/python2.7/site-packages/sqlalchemy/sql/annotation.py | evanma92/routeh | e8922faa745b6e842e8ca837ab490908bf87c764 | [
"BSD-3-Clause"
] | 15 | 2016-02-24T06:32:57.000Z | 2020-06-17T05:06:36.000Z | flask/lib/python2.7/site-packages/sqlalchemy/sql/annotation.py | evanma92/routeh | e8922faa745b6e842e8ca837ab490908bf87c764 | [
"BSD-3-Clause"
] | null | null | null | flask/lib/python2.7/site-packages/sqlalchemy/sql/annotation.py | evanma92/routeh | e8922faa745b6e842e8ca837ab490908bf87c764 | [
"BSD-3-Clause"
] | 4 | 2017-02-04T13:45:31.000Z | 2018-07-05T11:57:24.000Z | # sql/annotation.py
# Copyright (C) 2005-2015 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""The :class:`.Annotated` class and related routines; creates hash-equivalent
cop... | 31.178571 | 78 | 0.648994 |
166ad0fced45cb396b49525fe36b71847264e566 | 25,524 | py | Python | tb/test_ip_demux_64_4.py | junganghu/verilog-ethernet | cd6b87e984ff7cbeaf11f9468124019f5e654bdb | [
"MIT"
] | 1 | 2021-04-29T08:37:07.000Z | 2021-04-29T08:37:07.000Z | tb/test_ip_demux_64_4.py | zslwyuan/verilog-ethernet | cd6b87e984ff7cbeaf11f9468124019f5e654bdb | [
"MIT"
] | null | null | null | tb/test_ip_demux_64_4.py | zslwyuan/verilog-ethernet | cd6b87e984ff7cbeaf11f9468124019f5e654bdb | [
"MIT"
] | 1 | 2021-09-25T05:45:18.000Z | 2021-09-25T05:45:18.000Z | #!/usr/bin/env python
"""
Copyright (c) 2014-2018 Alex Forencich
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,... | 34.122995 | 116 | 0.659928 |
8a89cc07ecfe184724b601aaf1b6c5344a2e827f | 7,124 | py | Python | tacker/tests/base.py | mail2nsrajesh/tacker | dce6690659836c2885f1cf8227c19be234f8fe25 | [
"Apache-2.0"
] | null | null | null | tacker/tests/base.py | mail2nsrajesh/tacker | dce6690659836c2885f1cf8227c19be234f8fe25 | [
"Apache-2.0"
] | null | null | null | tacker/tests/base.py | mail2nsrajesh/tacker | dce6690659836c2885f1cf8227c19be234f8fe25 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010-2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 34.415459 | 76 | 0.67055 |
89a0d5584138d1cad0e15f874a2c5a18830fb276 | 7,826 | py | Python | harness/determined/load/_load_implementation.py | ybt195/determined | 913fdc3b81ef33c2760bdb128c8ce9179e4ab9b2 | [
"Apache-2.0"
] | 1 | 2020-04-27T21:22:22.000Z | 2020-04-27T21:22:22.000Z | harness/determined/load/_load_implementation.py | ybt195/determined | 913fdc3b81ef33c2760bdb128c8ce9179e4ab9b2 | [
"Apache-2.0"
] | null | null | null | harness/determined/load/_load_implementation.py | ybt195/determined | 913fdc3b81ef33c2760bdb128c8ce9179e4ab9b2 | [
"Apache-2.0"
] | null | null | null | import contextlib
import importlib
import json
import logging
import runpy
import sys
from typing import Any, Iterator, List, Optional, Tuple, Type, cast
import determined as det
from determined import horovod
from determined_common import check
def load_trial_implementation(entrypoint_spec: str) -> Type[det.Trial]:... | 38.551724 | 99 | 0.683491 |
40f1a6169c06bb29cc8528923126abde08714b0e | 623 | py | Python | PhythonExercicios/ex078.py | Luis-Otavio-Araujo/Curso-de-Python | 1283b26ee7057d61043cfbab53841bac5e1d4487 | [
"MIT"
] | 1 | 2021-07-31T18:57:46.000Z | 2021-07-31T18:57:46.000Z | PhythonExercicios/ex078.py | Luis-Otavio-Araujo/Curso-de-Python | 1283b26ee7057d61043cfbab53841bac5e1d4487 | [
"MIT"
] | null | null | null | PhythonExercicios/ex078.py | Luis-Otavio-Araujo/Curso-de-Python | 1283b26ee7057d61043cfbab53841bac5e1d4487 | [
"MIT"
] | null | null | null | lista = []
mai = men = 0
for c in range(0, 5) :
lista.append(int(input('Digite um valor: ')))
if c == 0 :
mai = men = lista[c]
else:
if lista[c] > mai :
mai = lista[c]
if lista[c] < men :
men = lista[c]
print('=' * 20)
print(lista)
print('=' * 20)
print(f'O... | 23.961538 | 69 | 0.494382 |
3b028b7fecb82ca4b39f2976cd7bbfb432801786 | 449 | py | Python | logger_example.py | dimk00z/logging | fd2533abe3d8e8b3bbd8dd881eeea55650d80748 | [
"MIT"
] | null | null | null | logger_example.py | dimk00z/logging | fd2533abe3d8e8b3bbd8dd881eeea55650d80748 | [
"MIT"
] | null | null | null | logger_example.py | dimk00z/logging | fd2533abe3d8e8b3bbd8dd881eeea55650d80748 | [
"MIT"
] | null | null | null | import logging
app_logger = logging.getLogger('app_logger')
app_logger.setLevel('DEBUG')
console_handler = logging.StreamHandler()
std_formatter = logging.Formatter(
fmt='{asctime} - {levelname} - {name} - {message}',
style='{')
console_handler.setFormatter(std_formatter)
app_logger.addHandler(console_handle... | 26.411765 | 55 | 0.786192 |
aecce3628ac6008f017b216dcafe758d91659f31 | 1,970 | py | Python | poetry/console/commands/env/info.py | uda/poetry | 30e3d7e33c20cbe2af8eda06e0db4888275caaa1 | [
"MIT"
] | 1 | 2021-03-22T12:50:53.000Z | 2021-03-22T12:50:53.000Z | poetry/console/commands/env/info.py | uda/poetry | 30e3d7e33c20cbe2af8eda06e0db4888275caaa1 | [
"MIT"
] | 4 | 2019-07-03T02:36:57.000Z | 2019-07-05T10:29:04.000Z | poetry/console/commands/env/info.py | uda/poetry | 30e3d7e33c20cbe2af8eda06e0db4888275caaa1 | [
"MIT"
] | 1 | 2021-07-19T10:02:31.000Z | 2021-07-19T10:02:31.000Z | from typing import TYPE_CHECKING
from typing import Optional
from cleo.helpers import option
from ..command import Command
if TYPE_CHECKING:
from poetry.utils.env import Env
class EnvInfoCommand(Command):
name = "env info"
description = "Displays information about the current environment."
optio... | 28.970588 | 87 | 0.509645 |
c8a21ab812a582e1c6a615e4d84b95ea5ad1303c | 32,585 | py | Python | auto_process_ngs/test/commands/test_report_cmd.py | fls-bioinformatics-core/auto_process_ngs | 1f07a08e14f118e6a61d3f37130515efc6049dd7 | [
"AFL-3.0"
] | 5 | 2017-01-31T21:37:09.000Z | 2022-03-17T19:26:29.000Z | auto_process_ngs/test/commands/test_report_cmd.py | fls-bioinformatics-core/auto_process_ngs | 1f07a08e14f118e6a61d3f37130515efc6049dd7 | [
"AFL-3.0"
] | 294 | 2015-08-14T09:00:30.000Z | 2022-03-18T10:17:05.000Z | auto_process_ngs/test/commands/test_report_cmd.py | fls-bioinformatics-core/auto_process_ngs | 1f07a08e14f118e6a61d3f37130515efc6049dd7 | [
"AFL-3.0"
] | 7 | 2017-11-23T07:52:21.000Z | 2020-07-15T10:12:05.000Z | #######################################################################
# Tests for report_cmd.py module
#######################################################################
import unittest
import tempfile
import shutil
import os
from auto_process_ngs.auto_processor import AutoProcess
from auto_process_ngs.analysis... | 38.837902 | 225 | 0.548044 |
a691a15dff008af822f476afab37252e5127c405 | 5,948 | py | Python | tests/utils_for_tests.py | dssg/diogenes | 52eda2a7adb22044e82779d05f91c927c1b95f3f | [
"MIT"
] | 21 | 2015-09-28T15:04:53.000Z | 2017-11-19T22:21:31.000Z | tests/utils_for_tests.py | dssg/diogenes | 52eda2a7adb22044e82779d05f91c927c1b95f3f | [
"MIT"
] | 28 | 2015-09-27T09:51:12.000Z | 2021-11-08T17:26:39.000Z | tests/utils_for_tests.py | dssg/diogenes | 52eda2a7adb22044e82779d05f91c927c1b95f3f | [
"MIT"
] | 10 | 2015-11-21T19:50:14.000Z | 2018-05-21T16:16:25.000Z | import os
import sys
import itertools as it
import numpy as np
import string
import diogenes.utils
from numpy.random import rand, seed
from contextlib import contextmanager
from StringIO import StringIO
TESTS_PATH = os.path.dirname(os.path.realpath(sys.argv[0]))
DATA_PATH = os.path.join(TESTS_PATH, 'data')
EIGHTS_PATH... | 36.268293 | 111 | 0.615501 |
7f8a44f9cb74a70c80b19a22059d50eefd8734d2 | 2,139 | py | Python | src/wavestate/declarative/properties/utilities.py | wavestate/wavestate-declarative | 600357451c443bbf67f2b096ffd797b34b922fb4 | [
"Apache-2.0"
] | null | null | null | src/wavestate/declarative/properties/utilities.py | wavestate/wavestate-declarative | 600357451c443bbf67f2b096ffd797b34b922fb4 | [
"Apache-2.0"
] | null | null | null | src/wavestate/declarative/properties/utilities.py | wavestate/wavestate-declarative | 600357451c443bbf67f2b096ffd797b34b922fb4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# SPDX-License-Identifier: Apache-2.0
# SPDX-FileCopyrightText: © 2021 Massachusetts Institute of Technology.
# SPDX-FileCopyrightText: © 2021 Lee McCuller <mcculler@mit.edu>
# NOTICE: authors should document their contributions in concisely in NOTICE
# with details inline ... | 26.407407 | 126 | 0.628799 |
43340c217ee637dd03c8004cb1d702031f4fd187 | 7,860 | py | Python | src/django_pg_bulk_update/compatibility.py | perpetua1/django-pg-bulk-update | a688b2f9f6e744f16538f9bd8e46d9887d65cd5e | [
"BSD-3-Clause"
] | null | null | null | src/django_pg_bulk_update/compatibility.py | perpetua1/django-pg-bulk-update | a688b2f9f6e744f16538f9bd8e46d9887d65cd5e | [
"BSD-3-Clause"
] | null | null | null | src/django_pg_bulk_update/compatibility.py | perpetua1/django-pg-bulk-update | a688b2f9f6e744f16538f9bd8e46d9887d65cd5e | [
"BSD-3-Clause"
] | null | null | null | """
This file contains number of functions to handle different software versions compatibility
"""
import importlib
import json
import sys
from typing import Dict, Any, Optional, Union, Tuple, List, Type, Callable
import django
from django.db import connection, connections, models, migrations
from django.db.models imp... | 33.02521 | 110 | 0.656107 |
ae40104ae02f5ab27f4f81a0267ad8f14eafd304 | 650 | py | Python | imcsdk/methodmeta/AaaLogoutMeta.py | ecoen66/imcsdk | b10eaa926a5ee57cea7182ae0adc8dd1c818b0ab | [
"Apache-2.0"
] | 31 | 2016-06-14T07:23:59.000Z | 2021-09-12T17:17:26.000Z | imcsdk/methodmeta/AaaLogoutMeta.py | sthagen/imcsdk | 1831eaecb5960ca03a8624b1579521749762b932 | [
"Apache-2.0"
] | 109 | 2016-05-25T03:56:56.000Z | 2021-10-18T02:58:12.000Z | imcsdk/methodmeta/AaaLogoutMeta.py | sthagen/imcsdk | 1831eaecb5960ca03a8624b1579521749762b932 | [
"Apache-2.0"
] | 67 | 2016-05-17T05:53:56.000Z | 2022-03-24T15:52:53.000Z | """This module contains the meta information of AaaLogout ExternalMethod."""
from ..imccoremeta import MethodMeta, MethodPropertyMeta
method_meta = MethodMeta("AaaLogout", "aaaLogout", "Version142b")
prop_meta = {
"cookie": MethodPropertyMeta("Cookie", "cookie", "StringMin0Max47", "Version142b", "InputOutput", F... | 34.210526 | 110 | 0.704615 |
032ebacadd0b44d1148e90b73aeea8bd87c4b506 | 937 | py | Python | site_scons/build_swig_header.py | GameClay/FlightlessManicotti | 3f224a64016eee07594c25858dc2cc8958688c40 | [
"Apache-2.0"
] | 5 | 2015-06-25T02:49:21.000Z | 2017-11-17T13:57:46.000Z | site_scons/build_swig_header.py | GameClay/FlightlessManicotti | 3f224a64016eee07594c25858dc2cc8958688c40 | [
"Apache-2.0"
] | null | null | null | site_scons/build_swig_header.py | GameClay/FlightlessManicotti | 3f224a64016eee07594c25858dc2cc8958688c40 | [
"Apache-2.0"
] | null | null | null | import os
# Auto-build a header which declares all of the module initialization
# functions from SWIG, and provides a macro to call them all.
def build(target, source, env):
t_name = str(target[0])
# Auto-generate header for swig files
swig_hdr = open(t_name, "w")
swig_hdr.write("#ifndef _SWIG_AUTOGEN_H_... | 34.703704 | 80 | 0.677695 |
11954a348fe5a09948f0e1066eb2d61136aecd93 | 3,034 | py | Python | envisage/service.py | anshsrtv/envisage | e50ab70146ed9927d684e2dd093cf2934b029691 | [
"BSD-3-Clause"
] | null | null | null | envisage/service.py | anshsrtv/envisage | e50ab70146ed9927d684e2dd093cf2934b029691 | [
"BSD-3-Clause"
] | null | null | null | envisage/service.py | anshsrtv/envisage | e50ab70146ed9927d684e2dd093cf2934b029691 | [
"BSD-3-Clause"
] | null | null | null | # (C) Copyright 2007-2020 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... | 30.959184 | 79 | 0.539552 |
fa67b93f0fb43eb2ba9437cbfd9d8e21821cd7ce | 384 | py | Python | Poker.py | errore/python_poker | 2cd9d06f181d5ec12afd5d27796a34ac9cc2ef0b | [
"MIT"
] | 2 | 2021-10-04T11:23:11.000Z | 2021-10-05T01:49:30.000Z | Poker.py | errore/python_poker | 2cd9d06f181d5ec12afd5d27796a34ac9cc2ef0b | [
"MIT"
] | null | null | null | Poker.py | errore/python_poker | 2cd9d06f181d5ec12afd5d27796a34ac9cc2ef0b | [
"MIT"
] | null | null | null | import random
# 创建卡片信息,player
card = [x for x in range(13)]
cards = []
player = [[], [], [], []]
# 单副牌(除去大小王)
for x in range(4):
color = list(map(lambda n: (n, x), card))
cards = cards + color
# 再加一副牌
cards = cards * 2
# 洗牌
random.shuffle(cards)
# 发牌
count = 0
for c in cards:
player[count ... | 17.454545 | 46 | 0.549479 |
d25b99a0674556966f8399e07fa56089ed6104e4 | 523 | py | Python | tests/python/processtest.py | fffy2366/image-processing | e1170b3f670e23e5728caa2716c96b90216ce4b3 | [
"MIT"
] | 38 | 2017-03-08T14:21:51.000Z | 2022-02-23T07:14:24.000Z | tests/python/processtest.py | haigemsa/image-processing | e1170b3f670e23e5728caa2716c96b90216ce4b3 | [
"MIT"
] | null | null | null | tests/python/processtest.py | haigemsa/image-processing | e1170b3f670e23e5728caa2716c96b90216ce4b3 | [
"MIT"
] | 16 | 2016-07-20T01:40:21.000Z | 2022-02-23T07:14:26.000Z | # coding: utf-8
import multiprocessing
import time
def func(msg):
print "msg:", msg
time.sleep(3)
print "end"
if __name__ == "__main__":
pool = multiprocessing.Pool(processes=3)
for i in xrange(4):
msg = "hello %d" % (i)
pool.apply_async(func, (msg,)) # 维持执行的进程总数为processes,当一个进程... | 23.772727 | 84 | 0.630975 |
300e222d0ae1137719e130a94950e90230b404e5 | 33,561 | py | Python | autofit/mapper/prior_model/abstract.py | arfon/PyAutoFit | 5926b13eefd97e089ee468cbec33452766edbd22 | [
"MIT"
] | 1 | 2021-01-18T23:20:31.000Z | 2021-01-18T23:20:31.000Z | autofit/mapper/prior_model/abstract.py | arfon/PyAutoFit | 5926b13eefd97e089ee468cbec33452766edbd22 | [
"MIT"
] | null | null | null | autofit/mapper/prior_model/abstract.py | arfon/PyAutoFit | 5926b13eefd97e089ee468cbec33452766edbd22 | [
"MIT"
] | null | null | null | import copy
import inspect
from functools import wraps
from numbers import Number
from random import random
from typing import Tuple, Optional
import numpy as np
from autoconf import conf
from autofit import exc
from autofit.mapper import model
from autofit.mapper.model import AbstractModel
from autofit.... | 35.401899 | 120 | 0.578022 |
6ea779747bf915e8063b7f9c0bede9cb3a4fa902 | 4,718 | py | Python | custom_components/dyson_local/select.py | lrb2/shenxn-ha-dyson | 0f047134849541386e2e131164125eb51281db65 | [
"MIT"
] | 158 | 2021-02-11T07:09:53.000Z | 2022-03-26T19:09:46.000Z | custom_components/dyson_local/select.py | lrb2/shenxn-ha-dyson | 0f047134849541386e2e131164125eb51281db65 | [
"MIT"
] | 103 | 2021-02-11T16:56:36.000Z | 2022-03-28T23:20:42.000Z | custom_components/dyson_local/select.py | lrb2/shenxn-ha-dyson | 0f047134849541386e2e131164125eb51281db65 | [
"MIT"
] | 40 | 2021-02-13T14:55:19.000Z | 2022-03-29T22:27:43.000Z | """Select platform for dyson."""
from typing import Callable
from libdyson import (
DysonPureCoolLink,
DysonPureHotCoolLink,
DysonPureHumidifyCool,
HumidifyOscillationMode,
WaterHardness,
)
from libdyson.const import AirQualityTarget
from homeassistant.components.select import SelectEntity
from h... | 30.24359 | 83 | 0.711106 |
ad2173825672311891b5f075720e608d63372198 | 6,479 | py | Python | prometheus/tests/test_prometheus.py | justinsousa/integrations-core | 223e337492a04de517bc35ec85ddf921108fd8d2 | [
"BSD-3-Clause"
] | 2 | 2019-05-28T03:48:29.000Z | 2019-07-05T07:05:58.000Z | prometheus/tests/test_prometheus.py | justinsousa/integrations-core | 223e337492a04de517bc35ec85ddf921108fd8d2 | [
"BSD-3-Clause"
] | 4 | 2019-07-03T02:53:19.000Z | 2019-07-10T14:52:14.000Z | prometheus/tests/test_prometheus.py | justinsousa/integrations-core | 223e337492a04de517bc35ec85ddf921108fd8d2 | [
"BSD-3-Clause"
] | 1 | 2020-01-15T16:58:51.000Z | 2020-01-15T16:58:51.000Z | # (C) Datadog, Inc. 2010-2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
from datadog_checks.prometheus import PrometheusCheck
instance = {
'prometheus_url': 'http://localhost:10249/metrics',
'namespace': 'prometheus',
'metrics': [{'metric1': 'renamed.metric1'}, 'metric2',... | 33.744792 | 117 | 0.621084 |
c1c547588c2227443f55258ca15a91d7404e9833 | 27,669 | py | Python | tests/data_context/datasource/test_data_context_datasource_runtime_data_connector_pandas_execution_engine.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | tests/data_context/datasource/test_data_context_datasource_runtime_data_connector_pandas_execution_engine.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | tests/data_context/datasource/test_data_context_datasource_runtime_data_connector_pandas_execution_engine.py | andyjessen/great_expectations | 74f7f2aa7b51144f34156ed49490dae4edaa5cb7 | [
"Apache-2.0"
] | null | null | null | from typing import Dict, List
import pandas as pd
import pytest
import great_expectations
import great_expectations.exceptions as ge_exceptions
from great_expectations import DataContext
from great_expectations.core.batch import Batch, RuntimeBatchRequest
from great_expectations.core.id_dict import BatchSpec
from gre... | 42.114155 | 114 | 0.711518 |
707760498d97705f7463c5101bccc25328df1b7e | 857 | py | Python | Chapter10/make_request.py | thatgeeman/Mastering-PyTorch | 2e861ae228de0fe716b373aef9adad67544ad5d4 | [
"MIT"
] | 132 | 2020-06-30T16:46:12.000Z | 2022-03-28T13:47:02.000Z | Chapter10/make_request.py | thatgeeman/Mastering-PyTorch | 2e861ae228de0fe716b373aef9adad67544ad5d4 | [
"MIT"
] | 8 | 2021-02-28T22:04:18.000Z | 2022-03-12T00:52:37.000Z | Chapter10/make_request.py | thatgeeman/Mastering-PyTorch | 2e861ae228de0fe716b373aef9adad67544ad5d4 | [
"MIT"
] | 68 | 2020-07-01T11:08:31.000Z | 2022-03-30T06:30:16.000Z | import io
import json
import requests
from PIL import Image
from torchvision import transforms
image = Image.open("./digit_image.jpg")
def image_to_tensor(image):
gray_image = transforms.functional.to_grayscale(image)
resized_image = transforms.functional.resize(gray_image, (28, 28))
input_image_tensor ... | 30.607143 | 103 | 0.750292 |
00b78b8ecc7cd6428e832b0582a995054641e952 | 5,749 | py | Python | sdks/python/http_client/v1/polyaxon_sdk/models/v1_logs.py | denisoliveirac/polyaxon | 21d33e50bbbd4bfbe474683f977eecf0b741ddd4 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_logs.py | denisoliveirac/polyaxon | 21d33e50bbbd4bfbe474683f977eecf0b741ddd4 | [
"Apache-2.0"
] | null | null | null | sdks/python/http_client/v1/polyaxon_sdk/models/v1_logs.py | denisoliveirac/polyaxon | 21d33e50bbbd4bfbe474683f977eecf0b741ddd4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 26.615741 | 123 | 0.579753 |
957eb088c4326240b89e8abdae571fc4f26ae7d9 | 4,731 | py | Python | kolibri/utils/sanity_checks.py | Tlazypanda/kolibri | a8ce3ae57022c8d46d817e55628afd177ed62946 | [
"MIT"
] | null | null | null | kolibri/utils/sanity_checks.py | Tlazypanda/kolibri | a8ce3ae57022c8d46d817e55628afd177ed62946 | [
"MIT"
] | 3 | 2021-03-10T08:57:45.000Z | 2021-09-02T07:03:34.000Z | kolibri/utils/sanity_checks.py | MikiasEphrem/cls | 1e54fd80a3015ad6c62a0b8ce1d95bcc26dd8184 | [
"MIT"
] | null | null | null | import logging
import os
import shutil
import sys
import portend
from django.apps import apps
from django.core.management import call_command
from django.db.utils import OperationalError
from .conf import OPTIONS
from .server import get_status
from .server import LISTEN_ADDRESS
from .server import NotRunning
logger ... | 30.921569 | 96 | 0.65483 |
c86d9f6f0d55322101f91081d24cf1962c8bbfbc | 10,861 | py | Python | data/text_data.py | valdersoul/bn-vae | b248193708e28f7314ba8f774d2112f0b7c69ab2 | [
"MIT"
] | 22 | 2020-06-01T12:51:47.000Z | 2022-01-21T10:46:37.000Z | data/text_data.py | valdersoul/bn-vae | b248193708e28f7314ba8f774d2112f0b7c69ab2 | [
"MIT"
] | 6 | 2020-08-14T06:56:58.000Z | 2021-08-17T02:43:04.000Z | data/text_data.py | valdersoul/bn-vae | b248193708e28f7314ba8f774d2112f0b7c69ab2 | [
"MIT"
] | 3 | 2020-11-24T01:06:56.000Z | 2021-11-15T10:11:56.000Z | import random
import torch
import numpy as np
from collections import defaultdict
class VocabEntry(object):
"""docstring for Vocab"""
def __init__(self, word2id=None):
super(VocabEntry, self).__init__()
if word2id:
self.word2id = word2id
self.unk_id = word2id['<unk>']... | 34.047022 | 109 | 0.565141 |
ce1083d7e078f3a7e6a8a3e84511467ba23f043e | 29,725 | py | Python | tests/test_ext_marshmallow.py | stefanv/apispec | 8863b236f15d4785aa7665825824c5919986c674 | [
"MIT"
] | null | null | null | tests/test_ext_marshmallow.py | stefanv/apispec | 8863b236f15d4785aa7665825824c5919986c674 | [
"MIT"
] | 1 | 2020-07-17T17:37:10.000Z | 2020-07-17T17:45:11.000Z | tests/test_ext_marshmallow.py | stefanv/apispec | 8863b236f15d4785aa7665825824c5919986c674 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import pytest
from marshmallow.fields import Field, DateTime, Dict, String, Nested, List
from marshmallow import Schema
from apispec import APISpec
from apispec.ext.marshmallow import MarshmallowPlugin
from apispec.ext.marshmallow.openapi import MARSHMALLOW_VERSION_INFO
from apis... | 38.503886 | 88 | 0.555694 |
cddefc5466c88b2a41f3830070da566442579e0b | 3,731 | py | Python | examples/tutorial/bag_of_tasks.py | chemlove/radical.ensemblemd | 0ec4b127760d2fee88d4eae1768fecec4bdd6b21 | [
"MIT"
] | null | null | null | examples/tutorial/bag_of_tasks.py | chemlove/radical.ensemblemd | 0ec4b127760d2fee88d4eae1768fecec4bdd6b21 | [
"MIT"
] | null | null | null | examples/tutorial/bag_of_tasks.py | chemlove/radical.ensemblemd | 0ec4b127760d2fee88d4eae1768fecec4bdd6b21 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__author__ = "Ole Weider <ole.weidner@rutgers.edu>"
__copyright__ = "Copyright 2014, http://radical.rutgers.edu"
__license__ = "MIT"
__example_name__ = "Bag of Tasks Example (generic)"
import sys
import os
import json
from radical.ensemblemd import Kernel
from radical.ensemblemd... | 35.533333 | 171 | 0.599303 |
2ad783106b7c35bd52698287318ba138699e4891 | 4,098 | py | Python | asm/asm_vgen.py | benx45h/SincereMicro | f96b7810da09bab4643d6ea9e075009c18fda954 | [
"MIT"
] | null | null | null | asm/asm_vgen.py | benx45h/SincereMicro | f96b7810da09bab4643d6ea9e075009c18fda954 | [
"MIT"
] | null | null | null | asm/asm_vgen.py | benx45h/SincereMicro | f96b7810da09bab4643d6ea9e075009c18fda954 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import re
def instArgC(aInst):
lookup = {
"nop" : 0,
"mov" : 2,
"jmp" : 1,
"slp" : 1,
"slx" : 1,
"add" : 1,
"sub" : 1,
"mul" : 1,
"not" : 0,
"dgt" : 1,
"dst" : 2,
"teq" : 2,
"tgt" :... | 20.80203 | 75 | 0.480234 |
d1725f77cf06b7c055ddd22e721f7efe017b5161 | 1,107 | py | Python | conanfile.py | MagnusS/vmbuild | 9b0f9e38826541f433970180b7503fed2e9fa140 | [
"Apache-2.0"
] | null | null | null | conanfile.py | MagnusS/vmbuild | 9b0f9e38826541f433970180b7503fed2e9fa140 | [
"Apache-2.0"
] | null | null | null | conanfile.py | MagnusS/vmbuild | 9b0f9e38826541f433970180b7503fed2e9fa140 | [
"Apache-2.0"
] | null | null | null | import os
from conans import ConanFile,tools,CMake
import shutil
class VmbuildConan(ConanFile):
settings= "os","arch"
name = "vmbuild"
license = 'Apache-2.0'
description = 'Run your application with zero overhead'
generators = 'cmake'
url = "http://www.includeos.org/"
exports_sources = "elf... | 29.131579 | 78 | 0.64589 |
ef26987b499f569ce74c1f8ab34af83d88960634 | 175 | py | Python | tests/test_add.py | fomightez/riscv-newop | 743871523a9fbe52eeebebcc66a0109bd21979f5 | [
"BSD-2-Clause"
] | 13 | 2020-05-26T23:17:47.000Z | 2021-12-30T05:57:56.000Z | tests/test_add.py | fomightez/riscv-newop | 743871523a9fbe52eeebebcc66a0109bd21979f5 | [
"BSD-2-Clause"
] | 30 | 2020-06-25T20:15:30.000Z | 2022-03-12T00:47:40.000Z | tests/test_add.py | fomightez/riscv-newop | 743871523a9fbe52eeebebcc66a0109bd21979f5 | [
"BSD-2-Clause"
] | 3 | 2020-09-11T18:00:51.000Z | 2021-07-09T14:39:56.000Z | import pytest
from bitarray import bitarray
from rvnewop import RV32
def test_add_example():
rv = RV32("32I")
assert str(rv.decodeHex("00e787b3")) == "add a5,a5,a4"
| 19.444444 | 58 | 0.708571 |
d7c7fe2aced24a8dd5a0b12e61e3d6cb881eb28e | 2,672 | py | Python | configs/uci_data/power_hint_8.py | psteinb/HINT | 8d5c3421fa898776eaa11a61bf0e3cb8b44de1ab | [
"MIT"
] | null | null | null | configs/uci_data/power_hint_8.py | psteinb/HINT | 8d5c3421fa898776eaa11a61bf0e3cb8b44de1ab | [
"MIT"
] | null | null | null | configs/uci_data/power_hint_8.py | psteinb/HINT | 8d5c3421fa898776eaa11a61bf0e3cb8b44de1ab | [
"MIT"
] | null | null | null | from collections import namedtuple
import torch
from FrEIA.framework import *
from FrEIA.modules import *
import sys
sys.path.insert(0, '../../')
from hint import *
from data import prepare_uci_loaders, Power as model
n_parameters = model.n_parameters
#################################################... | 31.435294 | 138 | 0.588698 |
8992ae2ec5aef119fd99a32af321382cb73a5462 | 2,514 | py | Python | CustomExtension.extension/STVTools.tab/Fix Warnings.panel/Warnings2.stack3/Correction.pulldown/Unjoin.pushbutton/script.py | Melca-G/Aeolus | e014cdbbffc1c650d569efd8750480bc5a4cdc3b | [
"MIT"
] | null | null | null | CustomExtension.extension/STVTools.tab/Fix Warnings.panel/Warnings2.stack3/Correction.pulldown/Unjoin.pushbutton/script.py | Melca-G/Aeolus | e014cdbbffc1c650d569efd8750480bc5a4cdc3b | [
"MIT"
] | null | null | null | CustomExtension.extension/STVTools.tab/Fix Warnings.panel/Warnings2.stack3/Correction.pulldown/Unjoin.pushbutton/script.py | Melca-G/Aeolus | e014cdbbffc1c650d569efd8750480bc5a4cdc3b | [
"MIT"
] | null | null | null | import sys
import ConfigParser
from os.path import expanduser
# Set system path
home = expanduser("~")
cfgfile = open(home + "\\STVTools.ini", 'r')
config = ConfigParser.ConfigParser()
config.read(home + "\\STVTools.ini")
# Master Path
syspath1 = config.get('SysDir','MasterPackage')
sys.path.append(syspath1)
# Built Pa... | 31.425 | 95 | 0.695306 |
7259f3a42b12f99b95e993aef75fb482951a4c67 | 1,033 | py | Python | h5py/highlevel.py | juliagarriga/h5py | 3aca66655cbde9fb71ea09a02189c586f88fc9b2 | [
"BSD-3-Clause"
] | null | null | null | h5py/highlevel.py | juliagarriga/h5py | 3aca66655cbde9fb71ea09a02189c586f88fc9b2 | [
"BSD-3-Clause"
] | 1 | 2019-10-22T09:28:53.000Z | 2019-10-22T11:55:10.000Z | h5py/highlevel.py | kif/h5py | d89bcc4cec7bbce0ae89c998e61d3c7387a9c73d | [
"BSD-3-Clause"
] | null | null | null | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
# pylint: disable=unused-import
"""
This is the... | 29.514286 | 77 | 0.75121 |
2e101d2fae9d61ed5881324964015eff3943dc41 | 10,718 | py | Python | properties.py | TakosukeGH/vmd_exporter | 983d87034e02ec6b4e7617b25f5037c139c15856 | [
"MIT"
] | 1 | 2019-07-10T11:58:22.000Z | 2019-07-10T11:58:22.000Z | properties.py | TakosukeGH/vmd_exporter | 983d87034e02ec6b4e7617b25f5037c139c15856 | [
"MIT"
] | null | null | null | properties.py | TakosukeGH/vmd_exporter | 983d87034e02ec6b4e7617b25f5037c139c15856 | [
"MIT"
] | null | null | null | import bpy
import logging
import math
import mathutils
import os
import bpy.utils.previews
from . exporter import VmdExporter
from bpy.types import Panel, PropertyGroup
from . import const
from bpy.props import PointerProperty, StringProperty, CollectionProperty, IntProperty, BoolProperty, IntVectorProperty, FloatVecto... | 38.833333 | 189 | 0.667475 |
4ba56eb79e915300c39968c737aade5edc435f80 | 471 | py | Python | string/0788_rotated_digits/0788_rotated_digits.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 6 | 2019-09-16T01:50:44.000Z | 2020-09-17T08:52:25.000Z | string/0788_rotated_digits/0788_rotated_digits.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | null | null | null | string/0788_rotated_digits/0788_rotated_digits.py | zdyxry/LeetCode | 33371285d0f3302158230f46e8b1b63b9f4639c4 | [
"Xnet",
"X11"
] | 4 | 2020-02-07T12:43:16.000Z | 2021-04-11T06:38:55.000Z | class Solution:
def rotatedDigits(self, N: int) -> int:
ans = 0
# For each x in [1, N], check whether it's good
for x in range(1, N+1):
S = str(x)
# Each x has only rotateable digits, and one of them
# rotates to a different digit
ans += (all(d... | 29.4375 | 64 | 0.52017 |
d72e3c5a507c5391317d90449bb6a9231cf41da9 | 1,178 | py | Python | var/spack/repos/builtin/packages/r-analysispageserver/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/r-analysispageserver/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/r-analysispageserver/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RAnalysispageserver(RPackage):
"""A framework for sharing interactive data and plots from ... | 40.62069 | 77 | 0.724958 |
3bdf4f4830d0ead06a30e77b8f96d30ecb0be46b | 159 | py | Python | nbautoexport/__init__.py | drivendataorg/nbautoexport | 3a3d67ac392d22bd2284ccce98f70ca76fd01637 | [
"MIT"
] | 46 | 2020-07-25T22:59:56.000Z | 2022-03-11T00:06:30.000Z | nbautoexport/__init__.py | drivendataorg/nbautoexport | 3a3d67ac392d22bd2284ccce98f70ca76fd01637 | [
"MIT"
] | 67 | 2020-07-01T18:55:20.000Z | 2022-03-16T20:20:27.000Z | nbautoexport/__init__.py | drivendataorg/nbautoexport | 3a3d67ac392d22bd2284ccce98f70ca76fd01637 | [
"MIT"
] | 7 | 2020-07-21T05:36:21.000Z | 2021-10-03T21:02:33.000Z | from nbautoexport.export import post_save
from nbautoexport.utils import __version__, get_logger
__all__ = [
"post_save",
"get_logger",
]
__version__
| 17.666667 | 54 | 0.767296 |
6ee7667d38541bbad0a8e1c0159dd5568da43ba6 | 14,121 | py | Python | scripts/EZpanda/EZ.py | K9Kraken/EZpanda | aa4b13c1391f864be4f34fb7f258aa954baf32ca | [
"BSD-3-Clause"
] | null | null | null | scripts/EZpanda/EZ.py | K9Kraken/EZpanda | aa4b13c1391f864be4f34fb7f258aa954baf32ca | [
"BSD-3-Clause"
] | 1 | 2021-09-21T19:05:18.000Z | 2021-09-21T20:19:22.000Z | scripts/EZpanda/EZ.py | K9Kraken/EZpanda | aa4b13c1391f864be4f34fb7f258aa954baf32ca | [
"BSD-3-Clause"
] | null | null | null | import os, builtins
from importlib import import_module, reload as reload_module
import random as pyrandom
from direct.showbase.ShowBase import ShowBase
from panda3d.core import BamCache, AntialiasAttrib, ClockObject, Filename, SamplerState, Shader, PythonTask, BitMask32, MouseButton
from panda3d.core import Vec2, Vec... | 32.763341 | 176 | 0.663976 |
0a1f6eb3fe67e83707de84455c31702df9d078fd | 2,487 | py | Python | example/resnet50_cifar10/dataset.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | 7 | 2020-05-24T03:19:26.000Z | 2020-05-24T03:20:00.000Z | example/resnet50_cifar10/dataset.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | null | null | null | example/resnet50_cifar10/dataset.py | unseenme/mindspore | 4ba052f0cd9146ac0ccc4880a778706f1b2d0af8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., 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 agreed to... | 33.16 | 87 | 0.661439 |
853f6f00b1e4201e1678a3f316233577739ff292 | 247 | py | Python | candy/__init__.py | gusarow4321/CandyDeliveryApp | 8cbafbc82b6b2514c9692dc1e432bd1ba4c1d091 | [
"MIT"
] | null | null | null | candy/__init__.py | gusarow4321/CandyDeliveryApp | 8cbafbc82b6b2514c9692dc1e432bd1ba4c1d091 | [
"MIT"
] | null | null | null | candy/__init__.py | gusarow4321/CandyDeliveryApp | 8cbafbc82b6b2514c9692dc1e432bd1ba4c1d091 | [
"MIT"
] | null | null | null | __author__ = 'Boris Gusarov'
__maintainer__ = __author__
__email__ = 'gusarow4321@gmail.com'
__license__ = 'MIT'
__version__ = '0.0.1'
__all__ = (
'__author__',
'__email__',
'__license__',
'__maintainer__',
'__version__',
)
| 15.4375 | 35 | 0.663968 |
169d3c4e63703b956144766496401638b1309af1 | 2,438 | py | Python | setup.py | andreas-koukorinis/Copulas-1 | 2875b7386a748391cfc3e320dec53567bbf2224f | [
"MIT"
] | null | null | null | setup.py | andreas-koukorinis/Copulas-1 | 2875b7386a748391cfc3e320dec53567bbf2224f | [
"MIT"
] | null | null | null | setup.py | andreas-koukorinis/Copulas-1 | 2875b7386a748391cfc3e320dec53567bbf2224f | [
"MIT"
] | 1 | 2022-02-24T12:55:01.000Z | 2022-02-24T12:55:01.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.md') as readme_file:
readme = readme_file.read()
with open('HISTORY.md') as history_file:
history = history_file.read()
install_requires = [
'numpy>=1.13.1,<1.17',
'pa... | 23.219048 | 104 | 0.589828 |
b7f9b32a1b9d4d0d09a7f90270ce6553d53c7e87 | 264 | py | Python | envoy.dependency.cve_scan/envoy/dependency/cve_scan/abstract/__init__.py | envoyproxy/pytooling | db8b60184f8a61b3184a111b0cfaff4780511b46 | [
"Apache-2.0"
] | 1 | 2021-12-09T19:24:48.000Z | 2021-12-09T19:24:48.000Z | envoy.dependency.cve_scan/envoy/dependency/cve_scan/abstract/__init__.py | envoyproxy/pytooling | db8b60184f8a61b3184a111b0cfaff4780511b46 | [
"Apache-2.0"
] | 392 | 2021-08-24T15:55:32.000Z | 2022-03-28T14:26:22.000Z | envoy.dependency.cve_scan/envoy/dependency/cve_scan/abstract/__init__.py | envoyproxy/pytooling | db8b60184f8a61b3184a111b0cfaff4780511b46 | [
"Apache-2.0"
] | 3 | 2021-10-06T13:43:11.000Z | 2021-11-29T13:48:56.000Z |
from .checker import ACVEChecker
from .cpe import ACPE
from .cve import ACVE
from .dependency import ADependency
from .version_matcher import ACVEVersionMatcher
__all__ = (
"ACPE",
"ACVE",
"ACVEChecker",
"ADependency",
"ACVEVersionMatcher")
| 17.6 | 47 | 0.723485 |
0194ed6cc88a00b829ae01643c991e7750e828e5 | 4,052 | py | Python | symgp/nelder_mead.py | ratnania/symgp | 37edd6f8e6f9cb3fa0cdf3dada37412c8d5a408a | [
"MIT"
] | 1 | 2018-12-16T23:16:01.000Z | 2018-12-16T23:16:01.000Z | symgp/nelder_mead.py | ratnania/symgp | 37edd6f8e6f9cb3fa0cdf3dada37412c8d5a408a | [
"MIT"
] | null | null | null | symgp/nelder_mead.py | ratnania/symgp | 37edd6f8e6f9cb3fa0cdf3dada37412c8d5a408a | [
"MIT"
] | null | null | null | import copy
'''
Pure Python/Numpy implementation of the Nelder-Mead algorithm.
Reference: https://en.wikipedia.org/wiki/Nelder%E2%80%93Mead_method
'''
def nelder_mead(f, x_start,
step=0.1, no_improve_thr=10e-6,
no_improv_break=10, max_iter=0,
alpha=1., gamma=2.... | 26.48366 | 98 | 0.514808 |
695b9aa774815f176c9d8c694a1042d5ab58449a | 13,938 | py | Python | src/oci/data_integration/data_integration_client_composite_operations.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_integration/data_integration_client_composite_operations.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/data_integration/data_integration_client_composite_operations.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 52.202247 | 245 | 0.690845 |
010d1d823edf0c831ac0b3e3ee483e5c67072f81 | 2,948 | py | Python | python_modules/libraries/dagster-airbyte/dagster_airbyte_tests/test_asset_defs.py | schrockn/dagster | 3bb4e9247a693e48d84e9c86f73d83633d91a5c7 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-airbyte/dagster_airbyte_tests/test_asset_defs.py | schrockn/dagster | 3bb4e9247a693e48d84e9c86f73d83633d91a5c7 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-airbyte/dagster_airbyte_tests/test_asset_defs.py | schrockn/dagster | 3bb4e9247a693e48d84e9c86f73d83633d91a5c7 | [
"Apache-2.0"
] | null | null | null | import pytest
import responses
from dagster_airbyte import airbyte_resource, build_airbyte_assets
from dagster import (
AssetKey,
MetadataEntry,
TableColumn,
TableSchema,
build_assets_job,
build_init_resource_context,
)
from .utils import get_sample_connection_json, get_sample_job_json
@resp... | 29.48 | 96 | 0.602103 |
3cf231fa48a240be67ddc086d68e9ad81149be21 | 1,727 | py | Python | activity8.py | uno-isqa-4900/activity8-jayanth0906 | 23bcd8f29133231922eca7ce9d78124486356572 | [
"MIT"
] | null | null | null | activity8.py | uno-isqa-4900/activity8-jayanth0906 | 23bcd8f29133231922eca7ce9d78124486356572 | [
"MIT"
] | null | null | null | activity8.py | uno-isqa-4900/activity8-jayanth0906 | 23bcd8f29133231922eca7ce9d78124486356572 | [
"MIT"
] | null | null | null | import csv
def Title():
print("Customer viewer program ")
print()
class CustomerData:
def __init__(self, custid="0", first_name="", last_name="", company_name="", address="", city="", state="", zip=""):
self.custid = custid
self.first_name = first_name
self.last_name = last_name
... | 22.428571 | 120 | 0.546034 |
0922c6af9798e7d018d9f18ce05b74bb5cf740cd | 6,777 | py | Python | intersight/configuration.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/configuration.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/configuration.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import urllib3
import sys
import logging
from six import iteritems
from six.moves ... | 30.12 | 97 | 0.599675 |
acb7c34298fadb4ce0152c57a5ae177d1f36006c | 33,112 | py | Python | test/functional/rpc_fundrawtransaction.py | retosen/Garlicoin-Catena | 23ef6c58b8b4cda49ff5a7ce4db2aac56706c893 | [
"MIT"
] | 168 | 2018-01-02T13:51:32.000Z | 2022-01-28T12:33:43.000Z | test/functional/rpc_fundrawtransaction.py | retosen/Garlicoin-Catena | 23ef6c58b8b4cda49ff5a7ce4db2aac56706c893 | [
"MIT"
] | 50 | 2018-01-02T06:48:18.000Z | 2022-01-24T13:32:29.000Z | test/functional/rpc_fundrawtransaction.py | retosen/Garlicoin-Catena | 23ef6c58b8b4cda49ff5a7ce4db2aac56706c893 | [
"MIT"
] | 90 | 2018-01-02T06:14:06.000Z | 2022-01-21T09:12:26.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the fundrawtransaction RPC."""
from test_framework.test_framework import BitcoinTestFramework
fro... | 45.173261 | 223 | 0.569612 |
5faa816ead2aad3c01a7ee73d0572cc23922f990 | 698 | py | Python | netbox_api/model/__init__.py | zinic/netbox_api | ace6cb2b60edd93f4a37f7a29e8d262a1c8e1fc4 | [
"MIT"
] | 2 | 2018-04-10T09:28:48.000Z | 2019-08-10T22:48:51.000Z | netbox_api/model/__init__.py | zinic/netbox_api | ace6cb2b60edd93f4a37f7a29e8d262a1c8e1fc4 | [
"MIT"
] | null | null | null | netbox_api/model/__init__.py | zinic/netbox_api | ace6cb2b60edd93f4a37f7a29e8d262a1c8e1fc4 | [
"MIT"
] | null | null | null | from .common import CustomFields
from .site import Site
from .device import Device, RackFaceConstant, DeviceStatusConstant
from .device_type import DeviceType, InterfaceOrderConstant, SubdeviceTypeConstant
from .device_role import DeviceRole
from .interface import Interface, FormFactorConstant
from .tenancy import Tena... | 41.058824 | 82 | 0.856734 |
ba65b45d2ddc6f04baed7714138d16f2cad2ea10 | 10,831 | py | Python | pip/commands/install.py | stefanor/pip | 1f0ea5f1c3454d1b2a8088e0922bb0ba367cc69b | [
"MIT"
] | null | null | null | pip/commands/install.py | stefanor/pip | 1f0ea5f1c3454d1b2a8088e0922bb0ba367cc69b | [
"MIT"
] | null | null | null | pip/commands/install.py | stefanor/pip | 1f0ea5f1c3454d1b2a8088e0922bb0ba367cc69b | [
"MIT"
] | null | null | null | import os
import sys
import tempfile
import shutil
from pip.req import InstallRequirement, RequirementSet, parse_requirements
from pip.log import logger
from pip.locations import src_prefix, virtualenv_no_global, distutils_scheme
from pip.backwardcompat import install_skip_reqs
from pip.basecommand import Command
from ... | 39.673993 | 133 | 0.603361 |
c3840cae01d2047f17fe8a2a69085a87d5a5cd65 | 6,002 | py | Python | rationalizers/lightning_models/highlights/spectra.py | deep-spin/spectra-rationalization | ef2b411dd7d6b83f6582fb98dd06d4f517c0912b | [
"MIT"
] | 8 | 2021-09-13T14:51:06.000Z | 2022-03-18T13:24:05.000Z | rationalizers/lightning_models/highlights/spectra.py | deep-spin/spectra-rationalization | ef2b411dd7d6b83f6582fb98dd06d4f517c0912b | [
"MIT"
] | null | null | null | rationalizers/lightning_models/highlights/spectra.py | deep-spin/spectra-rationalization | ef2b411dd7d6b83f6582fb98dd06d4f517c0912b | [
"MIT"
] | null | null | null | import logging
import pytorch_lightning as pl
import torch
from torch import nn
from torchnlp.encoders.text import StaticTokenizerEncoder
from rationalizers import constants
from rationalizers.builders import build_embedding_weights
from rationalizers.lightning_models.highlights.base import BaseRationalizer
from rati... | 38.722581 | 102 | 0.632123 |
911bd3d99794cedf481466ec0e6f6cb1b932af8a | 10,174 | py | Python | console/settings.py | mathematicalmichael/cannlytics | acc2b8c73fd3689283b41bd275a1885fe37153a6 | [
"MIT"
] | null | null | null | console/settings.py | mathematicalmichael/cannlytics | acc2b8c73fd3689283b41bd275a1885fe37153a6 | [
"MIT"
] | null | null | null | console/settings.py | mathematicalmichael/cannlytics | acc2b8c73fd3689283b41bd275a1885fe37153a6 | [
"MIT"
] | null | null | null | """
Django Settings | Cannlytics Console
Author: Keegan Skeate <keegan@cannlytics.com>
Created: 6/5/2021
Updated: 7/8/2021
License: MIT License
Description:
Django settings secured by Google Cloud Secret Manager.
"""
# Standard imports
import json
import io
import os
import re
# External imports
import environ
i... | 33.357377 | 92 | 0.587281 |
6190c8be1cd6af3151f4aeddc388b252924a3e77 | 92,627 | py | Python | sympy/printing/tests/test_latex.py | CameronKing/sympy | 3295b02c617a10ea8db0a070356cc0ba5a3b5121 | [
"BSD-3-Clause"
] | null | null | null | sympy/printing/tests/test_latex.py | CameronKing/sympy | 3295b02c617a10ea8db0a070356cc0ba5a3b5121 | [
"BSD-3-Clause"
] | null | null | null | sympy/printing/tests/test_latex.py | CameronKing/sympy | 3295b02c617a10ea8db0a070356cc0ba5a3b5121 | [
"BSD-3-Clause"
] | null | null | null | from sympy import (
Add, Abs, Chi, Ci, CosineTransform, Dict, Ei, Eq, FallingFactorial,
FiniteSet, Float, FourierTransform, Function, Indexed, IndexedBase, Integral,
Interval, InverseCosineTransform, InverseFourierTransform,
InverseLaplaceTransform, InverseMellinTransform, InverseSineTransform,
Lamb... | 39.584188 | 118 | 0.559103 |
2d393aa49dda6706c548552647c5dd1bce1ec51b | 1,241 | py | Python | ee/clickhouse/queries/test/test_paths.py | joesaunderson/posthog | 3a2a5ec2601216cd1adf6c69ccf3c4b140c0ac3c | [
"MIT"
] | null | null | null | ee/clickhouse/queries/test/test_paths.py | joesaunderson/posthog | 3a2a5ec2601216cd1adf6c69ccf3c4b140c0ac3c | [
"MIT"
] | null | null | null | ee/clickhouse/queries/test/test_paths.py | joesaunderson/posthog | 3a2a5ec2601216cd1adf6c69ccf3c4b140c0ac3c | [
"MIT"
] | null | null | null | from uuid import uuid4
from ee.clickhouse.materialized_columns.columns import materialize
from ee.clickhouse.models.event import create_event
from ee.clickhouse.queries.clickhouse_paths import ClickhousePaths
from ee.clickhouse.util import ClickhouseTestMixin
from posthog.constants import PAGEVIEW_EVENT, SCREEN_EVENT
... | 41.366667 | 138 | 0.774376 |
d27896ff3c05896eaebe480b86937e319561b8c4 | 2,183 | py | Python | parser/team10/Gramaticas/lexico.py | strickergt128/tytus | 93216dd9481ea0775da1d2967dc27be66872537f | [
"MIT"
] | null | null | null | parser/team10/Gramaticas/lexico.py | strickergt128/tytus | 93216dd9481ea0775da1d2967dc27be66872537f | [
"MIT"
] | null | null | null | parser/team10/Gramaticas/lexico.py | strickergt128/tytus | 93216dd9481ea0775da1d2967dc27be66872537f | [
"MIT"
] | null | null | null | #LEX
from ply import *
#lexer = lex.lex()
keywords = (
'create', 'varchar', 'date', 'not', 'null', 'identity', 'primary', 'key', 'alter', 'database', 'owner',
'table', 'add', 'drop', 'truncate', 'insert', 'into', 'values', 'update', 'set', 'from','delete', 'select',
'where', 'as', 'and', 'or','smallint',... | 31.185714 | 113 | 0.543289 |
97c3ae71f93e38c78ef78e0847073faef5cbba67 | 4,045 | py | Python | bug_thread/app.py | crawftv/bug_thread | 85635d589e5975dad38e38006a33985de1479697 | [
"BSD-3-Clause"
] | null | null | null | bug_thread/app.py | crawftv/bug_thread | 85635d589e5975dad38e38006a33985de1479697 | [
"BSD-3-Clause"
] | 1 | 2019-08-29T17:48:22.000Z | 2019-08-29T17:48:22.000Z | bug_thread/app.py | crawftv/bug_thread | 85635d589e5975dad38e38006a33985de1479697 | [
"BSD-3-Clause"
] | null | null | null | from functools import wraps
import json
from os import environ as env
from werkzeug.exceptions import HTTPException
from decouple import config
from .models import DB, User, Question, Answer
from dotenv import load_dotenv, find_dotenv
from flask import Flask, jsonify, redirect, render_template, session, url_for,... | 31.850394 | 120 | 0.654388 |
5b9695289815ebe2c465f83868b09e69d63adc0d | 84 | py | Python | Python180feet/oops/MyNewClass.py | parthasarathipandeygcp/gcpade001 | 1c353d48d21d276cc0597e88107f77525518264f | [
"Apache-2.0"
] | null | null | null | Python180feet/oops/MyNewClass.py | parthasarathipandeygcp/gcpade001 | 1c353d48d21d276cc0597e88107f77525518264f | [
"Apache-2.0"
] | null | null | null | Python180feet/oops/MyNewClass.py | parthasarathipandeygcp/gcpade001 | 1c353d48d21d276cc0597e88107f77525518264f | [
"Apache-2.0"
] | null | null | null | class MyNewClass:
'''This is a docstring. I have created a new class'''
pass | 28 | 57 | 0.666667 |
b379be2d3c0bab3daf1d2f811827459bc09fb3f8 | 5,195 | py | Python | app/services.py | dmnBrest/p2_flask | 7126d01a7bbd1c55f162972e9fffe9aee60e342c | [
"Apache-2.0"
] | null | null | null | app/services.py | dmnBrest/p2_flask | 7126d01a7bbd1c55f162972e9fffe9aee60e342c | [
"Apache-2.0"
] | 24 | 2015-01-03T20:39:09.000Z | 2015-01-25T19:54:09.000Z | app/services.py | dmnBrest/p2_flask | 7126d01a7bbd1c55f162972e9fffe9aee60e342c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from app import app, db, bbcode_parser
from models import User, Picture, Post, Forum, ForumTopic, ForumPost, PostHistory, ForumPostHistory, ForumTopicHistory
from slugify import slugify
from sqlalchemy.orm.attributes import get_history
import pygeoip, os
import re
class PostService(object):
... | 29.350282 | 141 | 0.708951 |
d133d3d565894ac862c83061924651f4c5438086 | 1,782 | py | Python | deployment_docker/app/main.py | themisbo/showcase | b7f1b716b1e369a43ba8cc25503062fbc49acb2b | [
"Apache-2.0"
] | null | null | null | deployment_docker/app/main.py | themisbo/showcase | b7f1b716b1e369a43ba8cc25503062fbc49acb2b | [
"Apache-2.0"
] | null | null | null | deployment_docker/app/main.py | themisbo/showcase | b7f1b716b1e369a43ba8cc25503062fbc49acb2b | [
"Apache-2.0"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.pipeline import Pipeline
from sklearn import svm
from sklearn.impute import KNNImputer
from sklearn.preprocessing import OneHotEncoder
from sklearn.preprocessing import StandardScaler
penguins = pd.read_csv('./app/PalmerPenguins.csv')
penguins = penguins.dropna()
pen... | 35.64 | 212 | 0.737935 |
26fb0adfde2732d9a57fbe64df494385aff356d4 | 2,919 | py | Python | blogs/migrations/0001_initial.py | 99900999/portfolio | 6b4857161a73e17ad9d324fee34962c039474e0c | [
"MIT"
] | 40 | 2020-07-26T10:51:02.000Z | 2022-03-01T23:45:44.000Z | blogs/migrations/0001_initial.py | ShakilAhmmed/nasimportfolio | 8bb62faa01486ed4755f4b1cb09b0bb13fd20863 | [
"MIT"
] | 10 | 2021-03-19T10:20:25.000Z | 2022-03-12T00:43:35.000Z | blogs/migrations/0001_initial.py | ShakilAhmmed/nasimportfolio | 8bb62faa01486ed4755f4b1cb09b0bb13fd20863 | [
"MIT"
] | 42 | 2020-07-26T15:04:03.000Z | 2022-03-12T01:28:44.000Z | # Generated by Django 3.0.4 on 2020-03-24 03:46
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 46.333333 | 158 | 0.581363 |
fff77228e07b0d2023f45fc072df33929c801b9b | 10,440 | py | Python | kinetics/ua_and_sa/sampling.py | wlawler45/kinetics | dd763ac27d7c0df8a9429419e911a22760ba5c5a | [
"MIT"
] | 13 | 2020-05-30T21:39:01.000Z | 2022-01-30T22:52:36.000Z | kinetics/ua_and_sa/sampling.py | wlawler45/kinetics | dd763ac27d7c0df8a9429419e911a22760ba5c5a | [
"MIT"
] | 7 | 2019-06-15T13:16:31.000Z | 2021-12-09T11:16:53.000Z | kinetics/ua_and_sa/sampling.py | willfinnigan/Kinetics | a607096f051c7721a7f2eac73a875366eaefef15 | [
"MIT"
] | 4 | 2019-09-23T09:46:11.000Z | 2022-03-18T20:30:03.000Z | from SALib.sample import latin, saltelli
import numpy as np
def parse_samples(samples, parameter_names, species_names):
"""
Takes a list of samples generated by salib and converts this to a list of tuples of dictionaries which can update the Model class.
Samples are created using the relevent salib functi... | 36.631579 | 144 | 0.66159 |
b569b518463c864693ebd532b66a49ab3bda5539 | 3,880 | py | Python | custom_components/ha_aurum/config_flow.py | bouwew/ha_aurum | 0c937b76abe2477870c5ae6c6504ddf6492f24d9 | [
"MIT"
] | null | null | null | custom_components/ha_aurum/config_flow.py | bouwew/ha_aurum | 0c937b76abe2477870c5ae6c6504ddf6492f24d9 | [
"MIT"
] | null | null | null | custom_components/ha_aurum/config_flow.py | bouwew/ha_aurum | 0c937b76abe2477870c5ae6c6504ddf6492f24d9 | [
"MIT"
] | null | null | null | """Config flow for the Aurum Meetstekker integration."""
import logging
from typing import Any, Dict
import voluptuous as vol
from homeassistant import config_entries, core, exceptions
from homeassistant.const import CONF_BASE, CONF_HOST, CONF_SCAN_INTERVAL
from homeassistant.core import callback
from homeassistant.h... | 32.333333 | 84 | 0.678093 |
e0af95b27de3fa94545e3da3a1cf2cdca1e17528 | 643 | py | Python | advent/show.py | siFeiden/advent2017 | be82e662f5f55e94ef88b378c6b555144fcffcd8 | [
"MIT"
] | null | null | null | advent/show.py | siFeiden/advent2017 | be82e662f5f55e94ef88b378c6b555144fcffcd8 | [
"MIT"
] | 1 | 2018-02-11T16:07:43.000Z | 2018-02-11T16:07:43.000Z | advent/show.py | siFeiden/advent2017 | be82e662f5f55e94ef88b378c6b555144fcffcd8 | [
"MIT"
] | null | null | null | from advent.door import Door
from advent import dates
@dates.nosy_wiebke_guard
def present(door):
try:
where = door.show()
print(door.title)
print()
print(door.description)
print()
print()
print('Loese dein Tuerchen in der Datei {}.'.format(where.file_path))
print('Dann start... | 26.791667 | 101 | 0.690513 |
9f92427410a85f182b0f87dcbc0f41c9ee18e1e1 | 506 | py | Python | autoPython/ch10/trafficLight.py | liweifdu/pyproject | 4b16dd6c55526b8b3ee6d3301ced39a783ef2eb3 | [
"MIT"
] | null | null | null | autoPython/ch10/trafficLight.py | liweifdu/pyproject | 4b16dd6c55526b8b3ee6d3301ced39a783ef2eb3 | [
"MIT"
] | null | null | null | autoPython/ch10/trafficLight.py | liweifdu/pyproject | 4b16dd6c55526b8b3ee6d3301ced39a783ef2eb3 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
market_2nd = {'ns': 'green', 'ew': 'red'}
mission_16th = {'ns': 'red', 'ew': 'green'}
def switchLights(stoplight):
for key in stoplight.keys():
if stoplight[key] == 'green':
stoplight[key] = 'yellow'
elif stoplight[key] == 'yellow':
stoplight[key] = 'red'... | 26.631579 | 81 | 0.575099 |
747c2f9d803c93e2a7820f43b3a4d2f74022fa34 | 353 | py | Python | third_party/oauth2client/oauth2client/__init__.py | bopopescu/build | 4e95fd33456e552bfaf7d94f7d04b19273d1c534 | [
"BSD-3-Clause"
] | null | null | null | third_party/oauth2client/oauth2client/__init__.py | bopopescu/build | 4e95fd33456e552bfaf7d94f7d04b19273d1c534 | [
"BSD-3-Clause"
] | null | null | null | third_party/oauth2client/oauth2client/__init__.py | bopopescu/build | 4e95fd33456e552bfaf7d94f7d04b19273d1c534 | [
"BSD-3-Clause"
] | 1 | 2020-07-23T11:05:06.000Z | 2020-07-23T11:05:06.000Z | """Client library for using OAuth2, especially with Google APIs."""
__version__ = '1.3'
GOOGLE_AUTH_URI = 'https://accounts.google.com/o/oauth2/auth'
GOOGLE_DEVICE_URI = 'https://accounts.google.com/o/oauth2/device/code'
GOOGLE_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke'
GOOGLE_TOKEN_URI = 'https://acc... | 39.222222 | 70 | 0.764873 |
61a9d8825ca329444857cfd009476b116aadd010 | 494 | py | Python | data/scripts/templates/object/tangible/component/droid/shared_struct_maint_module_base.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/component/droid/shared_struct_maint_module_base.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/component/droid/shared_struct_maint_module_base.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/component/droid/shared_struct_maint_module_base.iff"
result.attribu... | 29.058824 | 88 | 0.751012 |
579c1278558aee5222d094d3cd8e4f41008be26a | 46 | py | Python | pytorch_gan_trainer/models/acgan/__init__.py | kad99kev/pytorch_gan_trainer | f9db1072f29485843be3008e25d64abac8a36e2b | [
"MIT"
] | null | null | null | pytorch_gan_trainer/models/acgan/__init__.py | kad99kev/pytorch_gan_trainer | f9db1072f29485843be3008e25d64abac8a36e2b | [
"MIT"
] | 1 | 2022-01-07T12:20:35.000Z | 2022-02-07T12:28:07.000Z | pytorch_gan_trainer/models/acgan/__init__.py | kad99kev/pytorch_gan_trainer | f9db1072f29485843be3008e25d64abac8a36e2b | [
"MIT"
] | null | null | null | from .acgan import ACGAN
__all__ = ["ACGAN"]
| 11.5 | 24 | 0.695652 |
3ae2ce74347100e3fdf8e15c95acf8169c58d850 | 7,122 | py | Python | contagion/infection.py | chrhck/contagion | ea67c5db3fce02ddbd85142fcf545af948595a69 | [
"MIT"
] | 2 | 2020-10-08T10:23:47.000Z | 2021-11-19T09:00:19.000Z | contagion/infection.py | chrhck/contagion | ea67c5db3fce02ddbd85142fcf545af948595a69 | [
"MIT"
] | null | null | null | contagion/infection.py | chrhck/contagion | ea67c5db3fce02ddbd85142fcf545af948595a69 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Name: infection.py
Authors: Christian Haack, Stephan Meighen-Berger, Andrea Turcati
Constructs the infection.
"""
# Imports
import logging
from .config import config
from .pdfs import construct_pdf
_log = logging.getLogger(__name__)
class Infection(object):
"""
... | 26.875472 | 73 | 0.57175 |
4e0140b8934731adbffe5ba2c3cc14b80dc17a83 | 1,349 | py | Python | octobot/updater/updater_factory.py | Trading-Bot/CryptoBot | b39401f093eadfe461d6f441ba31d3b8cdb3f877 | [
"Apache-2.0"
] | 9 | 2018-04-14T18:42:16.000Z | 2018-05-22T03:45:31.000Z | octobot/updater/updater_factory.py | Trading-Bot/CryptoBot | b39401f093eadfe461d6f441ba31d3b8cdb3f877 | [
"Apache-2.0"
] | 151 | 2018-04-03T14:37:17.000Z | 2018-05-29T14:15:31.000Z | octobot/updater/updater_factory.py | Trading-Bot/CryptoBot | b39401f093eadfe461d6f441ba31d3b8cdb3f877 | [
"Apache-2.0"
] | 3 | 2018-04-22T10:53:28.000Z | 2018-05-23T08:10:18.000Z | # This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot)
# Copyright (c) 2021 Drakkar-Software, All rights reserved.
#
# OctoBot is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either
... | 39.676471 | 77 | 0.76427 |
a0d10951cf9bbed958fbe93a77273c977b3506a3 | 690 | py | Python | License.py | JunzuoWan/Add-subtraction-multiplication-and-division | eccad7adf0068e322c52c51ce87ad2f6a8be4401 | [
"Apache-2.0"
] | null | null | null | License.py | JunzuoWan/Add-subtraction-multiplication-and-division | eccad7adf0068e322c52c51ce87ad2f6a8be4401 | [
"Apache-2.0"
] | null | null | null | License.py | JunzuoWan/Add-subtraction-multiplication-and-division | eccad7adf0068e322c52c51ce87ad2f6a8be4401 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 6 15:05:51 2018
@author: J.Wan
"""
# Copyright 2018. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use these files except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 34.5 | 75 | 0.715942 |
7459069813206ef4710ec5ee0a64f88d730a0b60 | 1,316 | py | Python | blobrl/networks/base_dueling_network.py | garaytc/reinforcement | e6af258bf2ac3b45c20e0ed3d2f58ca7bc2b232f | [
"Apache-2.0"
] | 12 | 2020-05-19T18:58:55.000Z | 2021-02-21T20:26:46.000Z | blobrl/networks/base_dueling_network.py | garaytc/reinforcement | e6af258bf2ac3b45c20e0ed3d2f58ca7bc2b232f | [
"Apache-2.0"
] | 39 | 2020-05-19T18:41:42.000Z | 2021-01-16T08:31:06.000Z | blobrl/networks/base_dueling_network.py | garaytc/reinforcement | e6af258bf2ac3b45c20e0ed3d2f58ca7bc2b232f | [
"Apache-2.0"
] | 2 | 2020-05-19T15:15:04.000Z | 2020-05-21T08:45:59.000Z | import abc
from blobrl.networks import BaseNetwork
class BaseDuelingNetwork(BaseNetwork):
@abc.abstractmethod
def __init__(self, network):
"""
:param network: network when we add Value head
:type network: BaseNetwork and not BaseDuelingNetwork
"""
if not isinstance(n... | 36.555556 | 104 | 0.668693 |
9c3b375604b1556fb69ea78b14339a8157406959 | 235 | py | Python | blog/forms.py | AliBigdeli/mysite | b56c9afe21f19c752066a729c631c036c718ad17 | [
"MIT"
] | 1 | 2022-01-27T06:21:02.000Z | 2022-01-27T06:21:02.000Z | blog/forms.py | Amirhamidi2001/mysite | cc93a3a346232a06db88ce8e51c8c296bc71bf52 | [
"MIT"
] | null | null | null | blog/forms.py | Amirhamidi2001/mysite | cc93a3a346232a06db88ce8e51c8c296bc71bf52 | [
"MIT"
] | null | null | null | from django import forms
from blog.models import Comment
from captcha.fields import CaptchaField
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ['post','name','email','subject','message'] | 26.111111 | 60 | 0.710638 |
d275872e342b7705257606102b0e82570c04b3e7 | 6,118 | py | Python | pdftile.py | second-reality/pdftile | 422f7be7f0a15444ab24cc5eda2f73ce947a3e4f | [
"MIT"
] | 2 | 2020-11-25T22:40:57.000Z | 2022-02-18T19:32:29.000Z | pdftile.py | second-reality/pdftile | 422f7be7f0a15444ab24cc5eda2f73ce947a3e4f | [
"MIT"
] | null | null | null | pdftile.py | second-reality/pdftile | 422f7be7f0a15444ab24cc5eda2f73ce947a3e4f | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import argparse
import io
import math
from PyPDF2 import PdfFileWriter, PdfFileReader, pdf
from reportlab.pdfgen import canvas
import sys
formats = {
"Letter":(612,792),
"LetterSmall":(612,792),
"Tabloid":(792,1224),
"Ledger":(1224,792),
"Legal":(612,1008),
... | 31.374359 | 74 | 0.493789 |
4af75cbd3ac9f93690be83d41e4073b2b827dd4a | 10,415 | py | Python | Hydrophobic-thickness/2d-thickness/stat_lipid_pos.py | AspirinCode/MD-analysis-tools-scripts | dfc0d282c9a844f5b8b1935a3ae74b1aff577ff9 | [
"MIT"
] | 5 | 2020-01-29T01:01:54.000Z | 2022-02-11T09:19:20.000Z | Hydrophobic-thickness/2d-thickness/stat_lipid_pos.py | AspirinCode/MD-analysis-tools-scripts | dfc0d282c9a844f5b8b1935a3ae74b1aff577ff9 | [
"MIT"
] | null | null | null | Hydrophobic-thickness/2d-thickness/stat_lipid_pos.py | AspirinCode/MD-analysis-tools-scripts | dfc0d282c9a844f5b8b1935a3ae74b1aff577ff9 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import os,sys,math
filename = sys.argv[1]
simlen = int(sys.argv[2])
bsize=10 # int(sys.argv[4]) # block size -------------------------------
# number of blocks
nblck = int(simlen/bsize)
# set bin width...
xmin,xmax=(-90.0,90.0)
# dx=0.5 # 0.5 A bin
dx=1.0
# dx=0.4
nbin=int((xmax-xmin... | 29.173669 | 102 | 0.574364 |
ac8ceb247655a023868086cf061dbb00babab5f7 | 574 | py | Python | thinkpython_allen_downey/exercise_9_9.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_9_9.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | thinkpython_allen_downey/exercise_9_9.py | alirkaya/programming-textbook-solutions | 7362dce474b8a881d654f95604e09d1d0e76aec2 | [
"MIT"
] | null | null | null | def check_ages(i, j):
return str(i).zfill(2) == str(j)[::-1]
def find_difference():
for diff in range(10, 30):
son = 0
count = 0
while son < 80:
mother = son + diff
if check_ages(son, mother):
count += 1
son += 1
if count == 8:... | 21.259259 | 42 | 0.493031 |
33d81c3abf395f8d3ab17e27ed58427d0cbbe6d8 | 1,060 | py | Python | app/forms.py | NecroticOoze/NetworkHub | 3292f0c56886f6ce6ac3e36540c2f9c0222c17cf | [
"MIT"
] | null | null | null | app/forms.py | NecroticOoze/NetworkHub | 3292f0c56886f6ce6ac3e36540c2f9c0222c17cf | [
"MIT"
] | null | null | null | app/forms.py | NecroticOoze/NetworkHub | 3292f0c56886f6ce6ac3e36540c2f9c0222c17cf | [
"MIT"
] | null | null | null | from flask_wtf import FlaskForm
from markupsafe import Markup
from wtforms import StringField, PasswordField, SubmitField, BooleanField, FileField, SelectField
from app.models import User
class LoginForm(FlaskForm):
username = StringField("Username",validators=[])
password = PasswordField("Password",validators... | 39.259259 | 110 | 0.722642 |
bb5a389cf924fed92a033399bb5397834348aa61 | 15,416 | py | Python | server/src/tft/artemis/middleware.py | testing-farm/artemis | 75ac645a7742c35899acfa224234a7b8e6e7ef70 | [
"Apache-2.0"
] | null | null | null | server/src/tft/artemis/middleware.py | testing-farm/artemis | 75ac645a7742c35899acfa224234a7b8e6e7ef70 | [
"Apache-2.0"
] | null | null | null | server/src/tft/artemis/middleware.py | testing-farm/artemis | 75ac645a7742c35899acfa224234a7b8e6e7ef70 | [
"Apache-2.0"
] | null | null | null | # Copyright Contributors to the Testing Farm project.
# SPDX-License-Identifier: Apache-2.0
import datetime
import inspect
import json
import os
import threading
import traceback
from typing import TYPE_CHECKING, Any, Dict, Optional, Set, Union, cast
import dramatiq.broker
import dramatiq.message
import dramatiq.midd... | 33.010707 | 152 | 0.675143 |
9b2d79487e88a5a37684949abf84cf14894e5af5 | 6,984 | py | Python | numba/funcdesc.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | 3 | 2019-09-30T20:00:36.000Z | 2020-07-13T04:17:15.000Z | numba/funcdesc.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | null | null | null | numba/funcdesc.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | 1 | 2020-05-07T11:36:27.000Z | 2020-05-07T11:36:27.000Z | """
Function descriptors.
"""
from __future__ import print_function, division, absolute_import
from collections import defaultdict
import sys
from . import types, itanium_mangler
from .utils import _dynamic_modname, _dynamic_module
def default_mangler(name, argtypes):
return itanium_mangler.mangle(name, argtype... | 34.92 | 81 | 0.614261 |
cfcb6bf061beeae42a241fa4310c2ce725163e92 | 3,226 | py | Python | yts_downloader/yts_downloader.py | Kallbrig/yts-downloader | 311d1cfe27ebc5d81ee3d9789a23328bd3b9cf31 | [
"MIT"
] | 3 | 2019-10-29T21:07:47.000Z | 2020-08-02T21:00:01.000Z | yts_downloader/yts_downloader.py | Kallbrig/yts-downloader | 311d1cfe27ebc5d81ee3d9789a23328bd3b9cf31 | [
"MIT"
] | 2 | 2021-08-30T23:37:03.000Z | 2021-09-02T06:10:49.000Z | yts_downloader/yts_downloader.py | Kallbrig/yts-downloader | 311d1cfe27ebc5d81ee3d9789a23328bd3b9cf31 | [
"MIT"
] | 2 | 2019-07-21T13:33:45.000Z | 2020-08-02T20:52:00.000Z | import requests
from bs4 import BeautifulSoup
import argparse
def main():
# First argument is the movie name
parser = argparse.ArgumentParser()
parser.add_argument('movie', type=str,
help='Movie name in single quotes')
args = parser.parse_args()
name = args.movie.lower()
... | 31.019231 | 144 | 0.452263 |
bb5e8a0f726117e1c58a50eb3a1cc1ad2870156f | 13,576 | py | Python | hypatia/utility/utility.py | AAmedeo/Hypatia | 22e14bc9bbb043c4d7dbf5b881d9dadbce6c0de1 | [
"Apache-2.0"
] | 5 | 2021-12-17T15:16:12.000Z | 2022-03-24T10:42:33.000Z | hypatia/utility/utility.py | AAmedeo/Hypatia | 22e14bc9bbb043c4d7dbf5b881d9dadbce6c0de1 | [
"Apache-2.0"
] | 10 | 2022-01-11T09:44:52.000Z | 2022-03-30T12:29:50.000Z | hypatia/utility/utility.py | AAmedeo/Hypatia | 22e14bc9bbb043c4d7dbf5b881d9dadbce6c0de1 | [
"Apache-2.0"
] | 3 | 2021-12-17T15:30:12.000Z | 2022-03-23T15:37:42.000Z | # -*- coding: utf-8 -*-
"""
This module contains the utility functions from cerating the optimization problem
"""
import cvxpy as cp
import numpy as np
import pandas as pd
def stack(a, b, axis=0):
"""
concat cvxpy variable rows or columns
"""
if axis == 0:
return cp.vstack([a, b])
elif... | 29.008547 | 127 | 0.656747 |
704686caa20cc93acc1ea7724124669e32845cb0 | 1,382 | py | Python | dizicli/_720pizle.py | sh4dowb/DiziCLI | b9fb3a0ab5ddbf5d51d76f4da490853269e522dc | [
"MIT"
] | 2 | 2021-08-16T17:39:42.000Z | 2021-08-23T05:36:20.000Z | dizicli/_720pizle.py | sh4dowb/DiziCLI | b9fb3a0ab5ddbf5d51d76f4da490853269e522dc | [
"MIT"
] | null | null | null | dizicli/_720pizle.py | sh4dowb/DiziCLI | b9fb3a0ab5ddbf5d51d76f4da490853269e522dc | [
"MIT"
] | 1 | 2018-09-17T16:05:21.000Z | 2018-09-17T16:05:21.000Z | import json
import re
import execjs
import requests
from pyquery import PyQuery as pq
from .base import BaseMovieCrawler
class _720pizleCrawler(BaseMovieCrawler):
def __init__(self):
BaseMovieCrawler.__init__(self)
def generate_movie_page_url(self):
return "http://720pizle.com/izle/altyazi/... | 34.55 | 107 | 0.611433 |
42556424e10eb78b0c86ee04979ba582c7192051 | 617 | py | Python | scripts/test_counter.py | tianyudwang/adversarial_imitation_learning | 1d5b0ce16cf6453ed29650b6ef565664d6742680 | [
"MIT"
] | 1 | 2021-10-05T00:51:30.000Z | 2021-10-05T00:51:30.000Z | test/test_counter.py | yifanwu2828/Adversarial-imitation-learning | 8c0049ab75fd63ce600542d95fc392e9de2f5d50 | [
"MIT"
] | null | null | null | test/test_counter.py | yifanwu2828/Adversarial-imitation-learning | 8c0049ab75fd63ce600542d95fc392e9de2f5d50 | [
"MIT"
] | null | null | null | import numpy as np
from icecream import ic
if __name__ == '__main__':
length = 12
size = 6
a = np.ones(size) * -1
counter = 0
for i in range(size):
if i < size-1:
a[i] = i
else:
remain = length - (i+1)
counter += remain
a_mask = np.where(a==-1... | 21.275862 | 60 | 0.494327 |
614c39785c31f4a69795e8b72a7e0df8974f2992 | 441 | py | Python | tokenizer.py | luangtatipsy/transformation-techniques | b20e451d98c3cd05358b9474a8aacfd21e623755 | [
"MIT"
] | null | null | null | tokenizer.py | luangtatipsy/transformation-techniques | b20e451d98c3cd05358b9474a8aacfd21e623755 | [
"MIT"
] | null | null | null | tokenizer.py | luangtatipsy/transformation-techniques | b20e451d98c3cd05358b9474a8aacfd21e623755 | [
"MIT"
] | null | null | null | from copy import copy
from typing import List
from newmm_tokenizer.tokenizer import word_tokenize
def tokenize(text: str, min_char: int = 2, remove_placeholder: bool = False) -> List[str]:
tokens = word_tokenize(text, keep_whitespace=False)
if remove_placeholder:
tokens = [token for token in tok... | 31.5 | 90 | 0.716553 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.