hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1ace55887ac3b0a338cd4106a239bc110f7d2aa3 | 2,315 | py | Python | preprocessing/make_image_tag_matrix.py | avinashkaitha93/Image-Tag-Assignment | 65f56501a326432dd02f21fce705a0818292dff9 | [
"MIT"
] | null | null | null | preprocessing/make_image_tag_matrix.py | avinashkaitha93/Image-Tag-Assignment | 65f56501a326432dd02f21fce705a0818292dff9 | [
"MIT"
] | null | null | null | preprocessing/make_image_tag_matrix.py | avinashkaitha93/Image-Tag-Assignment | 65f56501a326432dd02f21fce705a0818292dff9 | [
"MIT"
] | null | null | null | from ast import literal_eval
import psycopg2
import numpy as np
import traceback
def make_image_tag_matrix(photo_id_file,image_tag_file):
try:
conn = psycopg2.connect("dbname='flickr2' user='postgres' host='129.219.60.22' password='password'")
# print "Successfully connected...."
excep... | 27.235294 | 109 | 0.54946 |
1ace7d7062fe1224509d7078ce74d9e94bce0b86 | 6,236 | py | Python | armi/tests/test_apps.py | albeanth/armi | 3755ffd2fcd1f7b6c557ef3e3f36126706a84c70 | [
"Apache-2.0"
] | null | null | null | armi/tests/test_apps.py | albeanth/armi | 3755ffd2fcd1f7b6c557ef3e3f36126706a84c70 | [
"Apache-2.0"
] | null | null | null | armi/tests/test_apps.py | albeanth/armi | 3755ffd2fcd1f7b6c557ef3e3f36126706a84c70 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 31.336683 | 88 | 0.66052 |
1ace87004da6274378063e9779f7f7e9de24fd8b | 4,585 | py | Python | retired_files/old_collision_resolution.py | facade-technologies-inc/facile | 4c9134dced71734641fed605e152880cd9ddefe3 | [
"MIT"
] | 2 | 2020-09-17T20:51:18.000Z | 2020-11-03T15:58:10.000Z | retired_files/old_collision_resolution.py | facade-technologies-inc/facile | 4c9134dced71734641fed605e152880cd9ddefe3 | [
"MIT"
] | 97 | 2020-08-26T05:07:08.000Z | 2022-03-28T16:01:49.000Z | retired_files/old_collision_resolution.py | facade-technologies-inc/facile | 4c9134dced71734641fed605e152880cd9ddefe3 | [
"MIT"
] | null | null | null | def resolveCollisions1(self, collidingSiblings: list) -> None:
"""
This function will resolve collisions of a component with its siblings.
:param collidingSiblings: siblings colliding with this component
:type collidingSiblings: list
:return: None
:rtype: NoneType
"""
work = [(self... | 41.681818 | 107 | 0.445583 |
1ace8ff1c5be542320378c794bd4604ca3a0528c | 565 | py | Python | setup.py | jaydenwindle/giftbit-python | cb2a96d4dc7aba32a540af6ff003cfd076cb924f | [
"MIT"
] | 1 | 2019-09-14T11:15:46.000Z | 2019-09-14T11:15:46.000Z | setup.py | jaydenwindle/giftbit-python | cb2a96d4dc7aba32a540af6ff003cfd076cb924f | [
"MIT"
] | null | null | null | setup.py | jaydenwindle/giftbit-python | cb2a96d4dc7aba32a540af6ff003cfd076cb924f | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="giftbit",
version="0.1",
author="Jayden Windle",
author_email="jaydenwindle@gmail.com",
description="A Python SDK for GiftBit's API",
long_description=long_description,
long_descri... | 29.736842 | 87 | 0.709735 |
1ace9b42dbb766f96da1cce9e268c2c92ceebad8 | 546 | py | Python | bin/encode.py | Evert-Arends/AuroraPlusClient | 7413f56c9b893abeb5beb1b546261e05ed3b2585 | [
"MIT"
] | null | null | null | bin/encode.py | Evert-Arends/AuroraPlusClient | 7413f56c9b893abeb5beb1b546261e05ed3b2585 | [
"MIT"
] | 2 | 2016-12-19T12:12:40.000Z | 2016-12-19T12:13:43.000Z | bin/encode.py | Evert-Arends/AuroraPlusClient | 7413f56c9b893abeb5beb1b546261e05ed3b2585 | [
"MIT"
] | null | null | null | import base64
class EncodingHandler:
def __init__(self):
print 'w0t w0t .o/'
@staticmethod
def encode(base64_object, method='base64'):
obj = None
if method == 'base64':
obj = base64.b64encode(str(base64_object))
# Multiple options here.
return obj
... | 18.2 | 54 | 0.580586 |
1aceadfefa21e60c7a98c02ab54e917868b6fc47 | 521 | py | Python | lambda_function.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | lambda_function.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | lambda_function.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | import softwareprocess.dispatch as dispatch
import re
def lambda_handler(event, context):
try:
if('querystring' in event):
eventParms = event['querystring'].strip('{}').replace(',',' ')
eventDict = dict(re.findall(r'(\S+)=(".*?"|\S+)', eventParms))
returnValue = dispatc... | 18.607143 | 74 | 0.560461 |
1acec153382bc976ba5834c9067001bc403e24ea | 4,159 | py | Python | rbc/omnisci_pipeline.py | krunalkharat/rbc | f3a4665bde03d2cef6521dcea030f22236435f79 | [
"BSD-3-Clause"
] | null | null | null | rbc/omnisci_pipeline.py | krunalkharat/rbc | f3a4665bde03d2cef6521dcea030f22236435f79 | [
"BSD-3-Clause"
] | null | null | null | rbc/omnisci_pipeline.py | krunalkharat/rbc | f3a4665bde03d2cef6521dcea030f22236435f79 | [
"BSD-3-Clause"
] | null | null | null | from .utils import get_version
from llvmlite import ir as llvm_ir
from .omnisci_array import builder_buffers, ArrayPointer
if get_version('numba') >= (0, 49):
from numba.core import ir, extending, types
from numba.core.compiler import CompilerBase, DefaultPassBuilder
from numba.core.compiler_machinery impor... | 37.468468 | 79 | 0.641981 |
1acec55b2ec27733033d69de278f28a40d7afeb1 | 1,482 | py | Python | userbot/plugins/dictionary.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/dictionary.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/dictionary.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | """Dictionary Plugin for @UniBorg
Syntax: .meaning <word>"""
import requests
from userbot.utils import lightning_cmd
@borg.on(lightning_cmd("meaning (.*)"))
async def _(event):
if event.fwd_from:
return
input_str = event.pattern_match.group(1)
input_url = "https://bots.shrimadhavuk.me/dictionary... | 31.531915 | 81 | 0.622807 |
1acf287ca4e882c9c5c8be9bce1bd8fe6174ff93 | 20,927 | py | Python | tests/handlers/test_e2e_keys.py | juhovan/synapse | 57feeab364325374b14ff67ac97c288983cc5cde | [
"Apache-2.0"
] | 1 | 2020-07-12T00:18:52.000Z | 2020-07-12T00:18:52.000Z | tests/handlers/test_e2e_keys.py | juhovan/synapse | 57feeab364325374b14ff67ac97c288983cc5cde | [
"Apache-2.0"
] | null | null | null | tests/handlers/test_e2e_keys.py | juhovan/synapse | 57feeab364325374b14ff67ac97c288983cc5cde | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2016 OpenMarket Ltd
# Copyright 2019 New Vector Ltd
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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
#
# ... | 40.714008 | 120 | 0.567831 |
1acf3408569dadbd19c59fbfbe569deada03168e | 4,127 | py | Python | sktime/forecasting/exp_smoothing.py | brettkoonce/sktime | 6336247bad0dac8692aa4b911c267f401dea4163 | [
"BSD-3-Clause"
] | 1 | 2020-12-28T15:24:13.000Z | 2020-12-28T15:24:13.000Z | sktime/forecasting/exp_smoothing.py | brettkoonce/sktime | 6336247bad0dac8692aa4b911c267f401dea4163 | [
"BSD-3-Clause"
] | 2 | 2020-04-20T12:26:42.000Z | 2020-04-22T17:09:14.000Z | sktime/forecasting/exp_smoothing.py | brettkoonce/sktime | 6336247bad0dac8692aa4b911c267f401dea4163 | [
"BSD-3-Clause"
] | 1 | 2020-12-28T15:24:15.000Z | 2020-12-28T15:24:15.000Z | __all__ = ["ExponentialSmoothing"]
__author__ = ["Markus Löning", "@big-o"]
from sktime.forecasting.base._statsmodels import _StatsModelsAdapter
from statsmodels.tsa.holtwinters import \
ExponentialSmoothing as _ExponentialSmoothing
class ExponentialSmoothing(_StatsModelsAdapter):
"""
Holt-Winters expone... | 36.848214 | 79 | 0.653017 |
1acf67b5f494b0cfb77a2907c55e0e8829cd0aab | 16,428 | py | Python | src/fortrace/botnet/bots/mariposa/mariposaprotocol.py | dasec/ForTrace | b8187522a2c83fb661e5a1a5f403da8f40a31ead | [
"MIT"
] | 1 | 2022-03-31T14:01:51.000Z | 2022-03-31T14:01:51.000Z | src/fortrace/botnet/bots/mariposa/mariposaprotocol.py | dasec/ForTrace | b8187522a2c83fb661e5a1a5f403da8f40a31ead | [
"MIT"
] | null | null | null | src/fortrace/botnet/bots/mariposa/mariposaprotocol.py | dasec/ForTrace | b8187522a2c83fb661e5a1a5f403da8f40a31ead | [
"MIT"
] | 1 | 2022-03-31T14:02:30.000Z | 2022-03-31T14:02:30.000Z | """ This module contains code that simulates the Mariposa bot-family command and control protocol.
Security notice: All urls or ip addresses listed in this module may potentially be harmful.
The author may not be held responsibility for any damage caused by using or visiting these urls or ip addresses.
You ... | 37.678899 | 201 | 0.661919 |
1acf7f60f16196495cfc49e6847d902e789be2e1 | 1,284 | py | Python | tests/plugins/environments/torch_elastic_deadlock.py | lemairecarl/pytorch-lightning | 85304d4672a9ed24a16f7f5b2abaa34148ab86f4 | [
"Apache-2.0"
] | null | null | null | tests/plugins/environments/torch_elastic_deadlock.py | lemairecarl/pytorch-lightning | 85304d4672a9ed24a16f7f5b2abaa34148ab86f4 | [
"Apache-2.0"
] | null | null | null | tests/plugins/environments/torch_elastic_deadlock.py | lemairecarl/pytorch-lightning | 85304d4672a9ed24a16f7f5b2abaa34148ab86f4 | [
"Apache-2.0"
] | null | null | null | import os
import sys
from contextlib import suppress
from pytorch_lightning import Trainer
from pytorch_lightning.plugins.training_type.ddp import DDPStrategy
from pytorch_lightning.utilities.exceptions import DeadlockDetectedException
from tests.helpers.boring_model import BoringModel
if os.getenv("PL_RUN_STANDALONE... | 33.789474 | 113 | 0.705607 |
1acf924a5b95b3e27f99c0107a3b84d8490c7b01 | 12,989 | py | Python | cirq/sim/clifford/clifford_simulator.py | Mu-L/Cirq | 680ae219fc53b4ecfdd1c948f5bb5658949ecead | [
"Apache-2.0"
] | null | null | null | cirq/sim/clifford/clifford_simulator.py | Mu-L/Cirq | 680ae219fc53b4ecfdd1c948f5bb5658949ecead | [
"Apache-2.0"
] | null | null | null | cirq/sim/clifford/clifford_simulator.py | Mu-L/Cirq | 680ae219fc53b4ecfdd1c948f5bb5658949ecead | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 35.010782 | 100 | 0.634152 |
1acfa1ffacd32d251be3382f38fd622571f4c538 | 104 | py | Python | forge/blade/systems/ai/__init__.py | narendasan/neural-mmo | 36a588db0021cccd7275cebef2cbdc5ee8eb40d5 | [
"MIT"
] | 4 | 2020-11-08T22:33:15.000Z | 2020-11-21T15:45:43.000Z | forge/blade/systems/ai/__init__.py | ThomasCloarec/neural-mmo | 094744f49ad2cff179ec21e27285258903b70098 | [
"MIT"
] | 1 | 2021-09-30T07:57:46.000Z | 2021-10-02T00:39:11.000Z | forge/blade/systems/ai/__init__.py | ThomasCloarec/neural-mmo | 094744f49ad2cff179ec21e27285258903b70098 | [
"MIT"
] | 2 | 2021-09-16T16:43:03.000Z | 2021-09-28T18:12:41.000Z | from . import utils
from . import move
from . import attack
from . import behavior
from . import policy
| 17.333333 | 22 | 0.759615 |
1acfb45b4665dd1f17f55dfe3b2d1d24dae52d62 | 8,857 | py | Python | ideaman_rec_python/DataSet.py | LibRec-Practical/ideaman-offline | f8341fc9ca77adcc1191c01037dda18c02d77b29 | [
"MIT"
] | 1 | 2021-06-21T06:41:12.000Z | 2021-06-21T06:41:12.000Z | ideaman_rec_python/DataSet.py | LibRec-Practical/ideaman-offline | f8341fc9ca77adcc1191c01037dda18c02d77b29 | [
"MIT"
] | null | null | null | ideaman_rec_python/DataSet.py | LibRec-Practical/ideaman-offline | f8341fc9ca77adcc1191c01037dda18c02d77b29 | [
"MIT"
] | null | null | null | """
数据生成有两种格式:
1. UserID - ItemID - Rating (- TimeStamp)
2. TenSor
"""
import sys, os
import threading
sys.path.append("../")
sys.path.extend([os.path.join(root, name) for root, dirs, _ in os.walk("../") for name in dirs])
import datetime
from ideaman_util.db import cur
from transformers import BertTokenizer, BertCon... | 29.231023 | 120 | 0.597945 |
1acfd524b667f23d3d459bf6e66425d9dc93a49d | 1,154 | py | Python | optimization/test/testAll.py | zengljnwpu/yaspc | 5e85efb5fb8bee02471814b10e950dfb5b04c5d5 | [
"MIT"
] | null | null | null | optimization/test/testAll.py | zengljnwpu/yaspc | 5e85efb5fb8bee02471814b10e950dfb5b04c5d5 | [
"MIT"
] | null | null | null | optimization/test/testAll.py | zengljnwpu/yaspc | 5e85efb5fb8bee02471814b10e950dfb5b04c5d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Author : axiqia, lzc80234@qq.com (liuzhaoci)
# Created : 2017/8/12
'''
测试并演示所有优化部分
'''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# 将yaspc所在路径加入path,确保import能正常运行
import sys
sys.path.append('../..')
from ... | 26.227273 | 83 | 0.771231 |
1acfe60c9c8a2f1adea6e788382a64f0c9b5a223 | 10,887 | py | Python | plugins/liquid_tags/notebook.py | tijptjik/thegodsproject | 8014f7b546289b9ca3aec64f6492b8312628d0a2 | [
"MIT"
] | null | null | null | plugins/liquid_tags/notebook.py | tijptjik/thegodsproject | 8014f7b546289b9ca3aec64f6492b8312628d0a2 | [
"MIT"
] | null | null | null | plugins/liquid_tags/notebook.py | tijptjik/thegodsproject | 8014f7b546289b9ca3aec64f6492b8312628d0a2 | [
"MIT"
] | null | null | null | """
Notebook Tag
------------
This is a liquid-style tag to include a static html rendering of an IPython
notebook in a blog post.
Syntax
------
{% notebook filename.ipynb [ cells[start:end] language[language] ]%}
The file should be specified relative to the ``notebooks`` subdirectory of the
content directory. Optio... | 29.991736 | 167 | 0.62965 |
1acffa5b1f4d1dfa727d3cdc5ac726c59360ce8d | 5,283 | py | Python | cogdl/data/data.py | tianjiansmile/cogdl | 4e0bbaf76e0e3bde0c8f57010159a63981278329 | [
"MIT"
] | null | null | null | cogdl/data/data.py | tianjiansmile/cogdl | 4e0bbaf76e0e3bde0c8f57010159a63981278329 | [
"MIT"
] | null | null | null | cogdl/data/data.py | tianjiansmile/cogdl | 4e0bbaf76e0e3bde0c8f57010159a63981278329 | [
"MIT"
] | null | null | null | import re
import torch
class Data(object):
r"""A plain old python object modeling a single graph with various
(optional) attributes:
Args:
x (Tensor, optional): Node feature matrix with shape :obj:`[num_nodes,
num_node_features]`. (default: :obj:`None`)
edge_index (LongTensor... | 35.938776 | 79 | 0.597388 |
1ad03cb8d121eacbd505728f591062339999716a | 560 | py | Python | chapter11-iface-abc/tombolist.py | cgDeepLearn/fluentpython | ff89ad5a7da59c71f57b6392c9f5d5c6178e0475 | [
"MIT"
] | 1 | 2019-11-23T05:57:02.000Z | 2019-11-23T05:57:02.000Z | chapter11-iface-abc/tombolist.py | cgDeepLearn/fluentpython | ff89ad5a7da59c71f57b6392c9f5d5c6178e0475 | [
"MIT"
] | null | null | null | chapter11-iface-abc/tombolist.py | cgDeepLearn/fluentpython | ff89ad5a7da59c71f57b6392c9f5d5c6178e0475 | [
"MIT"
] | 1 | 2019-11-23T05:57:43.000Z | 2019-11-23T05:57:43.000Z | # -*- coding: utf-8 -*-
"""
tombolist.py
TomboList是Tombola的虚拟子类
"""
from random import randrange
from tombola import Tombola
@Tombola.register # 1
class TomboList(list): # 2
def pick(self):
if self: # 3
position = randrange(len(self))
return self.pop(position) # 4
el... | 18.064516 | 57 | 0.598214 |
1ad03e86552c9f49d77c7af2d6ad6981c533c114 | 2,700 | py | Python | sqlfilter/testing/integration_test.py | pedro-r-marques/wikitools | c5bd7011234c8f4442cd292171ddd23bbbff8cb4 | [
"Apache-2.0"
] | 1 | 2020-03-26T05:52:11.000Z | 2020-03-26T05:52:11.000Z | sqlfilter/testing/integration_test.py | pedro-r-marques/wikitools | c5bd7011234c8f4442cd292171ddd23bbbff8cb4 | [
"Apache-2.0"
] | null | null | null | sqlfilter/testing/integration_test.py | pedro-r-marques/wikitools | c5bd7011234c8f4442cd292171ddd23bbbff8cb4 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import unittest
import subprocess
import tempfile
import os
class IntegrationTest(unittest.TestCase):
"""Test the filtering of pages and pagelinks.
"""
def setUp(self):
self._tmpdir = tempfile.mkdtemp()
print('TMPDIR={0}'.format(self._tmpdir))
... | 36 | 152 | 0.558889 |
1ad068e4ff37743703574f17654f3707beb91ccb | 3,658 | py | Python | lightly/openapi_generated/swagger_client/models/create_entity_response.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 1,515 | 2020-10-05T13:04:17.000Z | 2022-03-31T16:14:55.000Z | lightly/openapi_generated/swagger_client/models/create_entity_response.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 628 | 2020-10-14T11:38:51.000Z | 2022-03-31T14:40:54.000Z | lightly/openapi_generated/swagger_client/models/create_entity_response.py | Tekrific/lightly | 75a1d56b4cee77f68e0f3166e3a412711d0dbb2d | [
"MIT"
] | 108 | 2020-10-17T08:31:06.000Z | 2022-03-20T16:44:22.000Z | # coding: utf-8
"""
Lightly API
Lightly.ai enables you to do self-supervised learning in an easy and intuitive way. The lightly.ai OpenAPI spec defines how one can interact with our REST API to unleash the full potential of lightly.ai # noqa: E501
OpenAPI spec version: 1.0.0
Contact: support@lightly... | 29.264 | 220 | 0.582012 |
1ad0a8b23a33babe30a178e9840037c8551435be | 7,361 | py | Python | yolox/evaluators/coco_evaluator.py | junhai0428/YOLOX-OBB | 9f0d745b89ba6559e692ff06ba09b433b2f4594c | [
"Apache-2.0"
] | null | null | null | yolox/evaluators/coco_evaluator.py | junhai0428/YOLOX-OBB | 9f0d745b89ba6559e692ff06ba09b433b2f4594c | [
"Apache-2.0"
] | null | null | null | yolox/evaluators/coco_evaluator.py | junhai0428/YOLOX-OBB | 9f0d745b89ba6559e692ff06ba09b433b2f4594c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import contextlib
import io
import itertools
import json
import tempfile
import time
import torch
from loguru import logger
from tqdm import tqdm
from yolox.utils import (
gather,
is_main_process,
postprocess,
... | 33.157658 | 97 | 0.553186 |
1ad0b4954eea104046226b42de2f2b46bfa95cd0 | 1,028 | py | Python | venv/lib/python3.8/site-packages/mplfinance/_styledata/brasil.py | yuta-komura/vishnu | 67173b674d5f4f3be189474103612447ef69ab44 | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/mplfinance/_styledata/brasil.py | yuta-komura/vishnu | 67173b674d5f4f3be189474103612447ef69ab44 | [
"MIT"
] | 1 | 2020-04-21T02:42:32.000Z | 2020-04-21T02:42:32.000Z | venv/lib/python3.7/site-packages/mplfinance/_styledata/brasil.py | CatTiger/vnpy | 7901a0fb80a5b44d6fc752bd4b2b64ec62c8f84b | [
"MIT"
] | null | null | null | style = {'base_mpl_style': 'fast',
'marketcolors': {'candle': {'up': '#fedf00', 'down': '#002776'},
'edge' : {'up': '#fedf00', 'down': '#002776'},
'wick' : {'up': '#fedf00', 'down': '#002776'},
'ohlc' : {'up': '#fedf00', 'down': '... | 42.833333 | 73 | 0.361868 |
1ad0b744fd8d38bdaf45eb434963c6738ea805a5 | 4,330 | py | Python | ibis/expr/visualize.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 1 | 2020-08-04T08:29:44.000Z | 2020-08-04T08:29:44.000Z | ibis/expr/visualize.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 1 | 2020-10-02T23:51:48.000Z | 2020-10-03T00:54:29.000Z | ibis/expr/visualize.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 2 | 2020-11-27T22:21:50.000Z | 2021-04-03T09:36:25.000Z | import tempfile
from html import escape
import graphviz as gv
import ibis
import ibis.common.exceptions as com
import ibis.expr.operations as ops
import ibis.expr.types as ir
def get_type(expr):
try:
return str(expr.type())
except (AttributeError, NotImplementedError):
pass
try:
... | 30.069444 | 78 | 0.539954 |
1ad0d3909d8fbb22b415e08dc7fa1201ccb00b6e | 1,619 | py | Python | test/PySrc/tests/test_code_tracer_structural_match.py | Marascax/live-py-plugin | a8ac7170b765c43e0b1d36b44e4abd4eb8fff211 | [
"MIT"
] | 224 | 2015-03-22T23:40:52.000Z | 2022-03-01T21:45:51.000Z | test/PySrc/tests/test_code_tracer_structural_match.py | Marascax/live-py-plugin | a8ac7170b765c43e0b1d36b44e4abd4eb8fff211 | [
"MIT"
] | 371 | 2015-04-28T05:14:00.000Z | 2022-03-28T01:31:22.000Z | test/PySrc/tests/test_code_tracer_structural_match.py | Marascax/live-py-plugin | a8ac7170b765c43e0b1d36b44e4abd4eb8fff211 | [
"MIT"
] | 53 | 2015-10-30T07:52:07.000Z | 2022-02-28T12:56:35.000Z | import sys
import pytest
from space_tracer.main import TraceRunner
@pytest.mark.skipif(sys.version_info < (3, 10),
reason='Structural pattern matching added in 3.10.')
def test_structural_pattern_match():
code = """\
x = 10
match x:
case 20:
print('twenty')
case y:
p... | 18.609195 | 72 | 0.593576 |
1ad0d65e412ba4ce1bde85bde7dd1259282ea285 | 871 | py | Python | python/ray/serve/tests/test_handle.py | jody3t/ray-jo | 94dc11b6fb2b077ca0a2d4d0d376adfb2002c795 | [
"Apache-2.0"
] | null | null | null | python/ray/serve/tests/test_handle.py | jody3t/ray-jo | 94dc11b6fb2b077ca0a2d4d0d376adfb2002c795 | [
"Apache-2.0"
] | null | null | null | python/ray/serve/tests/test_handle.py | jody3t/ray-jo | 94dc11b6fb2b077ca0a2d4d0d376adfb2002c795 | [
"Apache-2.0"
] | null | null | null | import ray
from ray import serve
import requests
def test_handle_in_endpoint(serve_instance):
serve.init()
class Endpoint1:
def __call__(self, flask_request):
return "hello"
class Endpoint2:
def __init__(self):
self.handle = serve.get_handle("endpoint1", missing_... | 24.194444 | 74 | 0.619977 |
1ad0d94997148d6afc468df9f7242b4f0b31757a | 1,518 | py | Python | custom_components/seatconnect/sensor.py | jordibsk10/homeassistant-seatconnect | fb44f654230ba87e41dfdac19736dc2c1dcf00a7 | [
"Apache-2.0"
] | 21 | 2021-02-06T16:42:48.000Z | 2022-02-02T23:23:34.000Z | custom_components/seatconnect/sensor.py | jordibsk10/homeassistant-seatconnect | fb44f654230ba87e41dfdac19736dc2c1dcf00a7 | [
"Apache-2.0"
] | 24 | 2021-06-14T12:46:55.000Z | 2022-03-01T10:07:09.000Z | custom_components/seatconnect/sensor.py | jordibsk10/homeassistant-seatconnect | fb44f654230ba87e41dfdac19736dc2c1dcf00a7 | [
"Apache-2.0"
] | 8 | 2021-06-03T09:35:37.000Z | 2022-02-14T12:51:19.000Z | """
Support for Seat Connect Platform
"""
import logging
from . import DATA_KEY, DOMAIN, SeatEntity
from .const import DATA
from homeassistant.const import CONF_RESOURCES
_LOGGER = logging.getLogger(__name__)
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
"""Set up the Se... | 27.6 | 86 | 0.657444 |
1ad0dbfa612397dd5fb1374abbe52b34adc64371 | 29 | py | Python | offregister/parser/auth.py | offscale/offregister | ac9ce3b3cdefac15ef5e8c6a3bce9ac2335a526c | [
"Apache-2.0",
"MIT"
] | 2 | 2021-02-25T00:14:45.000Z | 2021-02-26T00:30:05.000Z | offregister/parser/auth.py | offscale/offregister | ac9ce3b3cdefac15ef5e8c6a3bce9ac2335a526c | [
"Apache-2.0",
"MIT"
] | null | null | null | offregister/parser/auth.py | offscale/offregister | ac9ce3b3cdefac15ef5e8c6a3bce9ac2335a526c | [
"Apache-2.0",
"MIT"
] | 3 | 2016-07-19T09:12:12.000Z | 2021-01-09T22:33:40.000Z | class Auth(object):
pass
| 9.666667 | 19 | 0.655172 |
1ad0fad7801af3884c2c42e95a13fabad90b4905 | 4,867 | py | Python | tests/test_analysis_tools.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 77 | 2019-06-09T14:23:33.000Z | 2022-03-22T21:34:01.000Z | tests/test_analysis_tools.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 353 | 2019-06-05T23:54:39.000Z | 2022-03-31T21:21:47.000Z | tests/test_analysis_tools.py | bfis/coffea | e5e67d410e86faee1172fcc864774d7024d97653 | [
"BSD-3-Clause"
] | 71 | 2019-06-07T02:04:11.000Z | 2022-03-05T21:03:45.000Z | import numpy as np
from dummy_distributions import dummy_jagged_eta_pt
import pytest
def test_weights():
from coffea.analysis_tools import Weights
counts, test_eta, test_pt = dummy_jagged_eta_pt()
scale_central = np.random.normal(loc=1.0, scale=0.01, size=counts.size)
scale_up = scale_central * 1.10... | 30.803797 | 86 | 0.660366 |
1ad103bc9a3109fe286df674ba181c8c8195861b | 2,115 | py | Python | ssl_image_classification/algorithms/mixup.py | JanMarcelKezmann/Semi-Supervised-Learning-Image-Classification | b32599d1a5f28beefb4f9a744087e1dc47bd9906 | [
"MIT"
] | 4 | 2021-04-16T18:56:46.000Z | 2021-11-18T07:14:04.000Z | ssl_image_classification/algorithms/mixup.py | JanMarcelKezmann/Semi-Supervised-Learning-Image-Classification | b32599d1a5f28beefb4f9a744087e1dc47bd9906 | [
"MIT"
] | 2 | 2022-02-05T16:55:14.000Z | 2022-03-06T11:04:23.000Z | ssl_image_classification/algorithms/mixup.py | JanMarcelKezmann/Semi-Supervised-Learning-Image-Classification | b32599d1a5f28beefb4f9a744087e1dc47bd9906 | [
"MIT"
] | 2 | 2022-02-08T12:43:49.000Z | 2022-03-06T10:47:56.000Z | # Imports
import tensorflow as tf
@tf.function
def mixup(x1, x2, y1, y2, beta, alg):
"""
Applies mixup algorithm to input images and its corresponding labels and
returns them.
Args:
x1: tensor, 1st batch of images
x2: tensor, 2nd batch of images
y1: tensor, 1st bat... | 38.454545 | 99 | 0.650591 |
1ad11a4fc1d621f3839e14349a99d265d5b3a447 | 10,708 | py | Python | cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hnas_utils.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hnas_utils.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/drivers/hitachi/test_hitachi_hnas_utils.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 Hitachi Data Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unle... | 35.932886 | 79 | 0.666698 |
1ad123f4d3afc91f137cbafb5aab280ecf0c85b2 | 26 | py | Python | temp_models/__init__.py | 13263081188/torch-cam | 11359fbecf9d4f4616dd37bb7e84026389d2da45 | [
"Apache-2.0"
] | 1 | 2021-06-18T09:22:40.000Z | 2021-06-18T09:22:40.000Z | temp_models/__init__.py | 13263081188/torch-cam | 11359fbecf9d4f4616dd37bb7e84026389d2da45 | [
"Apache-2.0"
] | null | null | null | temp_models/__init__.py | 13263081188/torch-cam | 11359fbecf9d4f4616dd37bb7e84026389d2da45 | [
"Apache-2.0"
] | null | null | null | from .Resnet18VAE import * | 26 | 26 | 0.807692 |
1ad127e67ad25f5325fb635e649bec74a95aed3b | 3,328 | py | Python | utils/test_notifications.py | Ibrahem3amer/bala7 | 70638c121ea85ff0e6a650c5f2641b0b3b04d6d0 | [
"Apache-2.0"
] | null | null | null | utils/test_notifications.py | Ibrahem3amer/bala7 | 70638c121ea85ff0e6a650c5f2641b0b3b04d6d0 | [
"Apache-2.0"
] | null | null | null | utils/test_notifications.py | Ibrahem3amer/bala7 | 70638c121ea85ff0e6a650c5f2641b0b3b04d6d0 | [
"Apache-2.0"
] | null | null | null | from test_plus.test import APITestCase, TestCase
from utils.notifications import BaseNotification
class TestAPIIntegeration(TestCase):
def setUp(self):
self.segments = ['test_users']
self.messages = {
"en": "this is test message content",
"ar": "هذه رسالة تجربة"
}
... | 41.08642 | 103 | 0.662861 |
1ad131ebd9a86405dc719f708a1d2b008aeb67ba | 45,059 | py | Python | chatbot_agent/chatbot_agent/policy/policy_agenda_multiwoz.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | chatbot_agent/chatbot_agent/policy/policy_agenda_multiwoz.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | chatbot_agent/chatbot_agent/policy/policy_agenda_multiwoz.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
"""
__time__ = '2019/1/31 10:24'
import copy
import json
import os
import random
import re
import logging
import pnlp
from chatbot_agent.interface.policy import Policy
from chatbot_agent.policy.goal_generator import GoalGenerator
from chatbot_agent.policy.multiwoz_... | 38.088757 | 214 | 0.552498 |
1ad15f3dbbc5bad54133e4db354b9e3959684a63 | 2,351 | py | Python | simple_app/simple_callbacks.py | Will-Cooper/SIMPLE-web | 166d2508909c9ce041db28699d5496a5a173be92 | [
"BSD-3-Clause"
] | 2 | 2021-01-04T05:32:28.000Z | 2021-04-27T19:28:45.000Z | simple_app/simple_callbacks.py | Will-Cooper/SIMPLE-web | 166d2508909c9ce041db28699d5496a5a173be92 | [
"BSD-3-Clause"
] | 61 | 2020-10-20T20:32:26.000Z | 2022-03-29T20:55:30.000Z | simple_app/simple_callbacks.py | Will-Cooper/SIMPLE-web | 166d2508909c9ce041db28699d5496a5a173be92 | [
"BSD-3-Clause"
] | 5 | 2020-10-20T20:27:47.000Z | 2022-02-15T21:40:50.000Z | """
Dump for all the javascript callbacks to be used in website
"""
class JSCallbacks:
dropdownx_js = """
for (let i = 0; i < this.options.length; i++) {
if (this.value == this.options[i][0]) {
this.label = this.options[i][1];
break;
}
}
var fullvalue = this.val... | 25.010638 | 64 | 0.520204 |
1ad1cf95cf37411492fd5c8e15ab6d17c6119834 | 9,784 | py | Python | setup.py | sheerinZ/nlu | a223eee4b077a6b832f47e5e6125167fe0922687 | [
"Apache-2.0"
] | 1 | 2021-05-01T01:23:18.000Z | 2021-05-01T01:23:18.000Z | setup.py | sheerinZ/nlu | a223eee4b077a6b832f47e5e6125167fe0922687 | [
"Apache-2.0"
] | null | null | null | setup.py | sheerinZ/nlu | a223eee4b077a6b832f47e5e6125167fe0922687 | [
"Apache-2.0"
] | null | null | null | """A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
here = path.absp... | 43.874439 | 302 | 0.685098 |
1ad22493bbc61a1d1a3870ffe384937bc9493a95 | 1,025 | py | Python | suspicious_urls_ips/feeds/policeman.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/policeman.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/policeman.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from antivirus.lists_based_engine.update import retrieve_content
from antivirus.lists_based_engine.settings import DOMAIN_TYPE
from antivirus.lists_based_engi... | 32.03125 | 116 | 0.726829 |
1ad25ce5f3eae9a31b54767356ec00c91e692eb7 | 16,357 | py | Python | languages/en-gb.py | nursix/DRKCM | 09328289ff721c416494398aa751ff99906327cb | [
"MIT"
] | 3 | 2022-01-26T08:07:54.000Z | 2022-03-21T21:53:52.000Z | languages/en-gb.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | languages/en-gb.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | {
"A volunteer is defined as active if they've participated in an average of 8 or more hours of Program work or Trainings per month in the last year": "A volunteer is defined as active if they've participated in an average of 8 or more hours of Programme work or Trainings per month in the last year",
"Acronym of the or... | 68.154167 | 381 | 0.783885 |
1ad2a0143f76d20625dcb77dc94563143c14c868 | 8,828 | py | Python | airflow_client/test/test_error.py | sptsakcg/airflow-client-python | 38a14e8641988f8cc88a5b27632ef4198bdb2843 | [
"Apache-2.0"
] | null | null | null | airflow_client/test/test_error.py | sptsakcg/airflow-client-python | 38a14e8641988f8cc88a5b27632ef4198bdb2843 | [
"Apache-2.0"
] | null | null | null | airflow_client/test/test_error.py | sptsakcg/airflow-client-python | 38a14e8641988f8cc88a5b27632ef4198bdb2843 | [
"Apache-2.0"
] | null | null | null | """
Airflow API (Stable)
# Overview To facilitate management, Apache Airflow supports a range of REST API endpoints across its objects. This section provides an overview of the API design, methods, and supported use cases. Most of the endpoints accept `JSON` as input and return `JSON` responses. This means t... | 238.594595 | 8,173 | 0.75725 |
1ad2a923d9257acaef16ce0a54aba48d1c43e728 | 1,321 | py | Python | Homework/Refactoring-Pep8/whitespace_naming_convention2.py | caocmai/SPD-2.31-Testing-and-Architecture | 5e9a86849dff795cc06c7a41af49c030df91eaa8 | [
"MIT"
] | null | null | null | Homework/Refactoring-Pep8/whitespace_naming_convention2.py | caocmai/SPD-2.31-Testing-and-Architecture | 5e9a86849dff795cc06c7a41af49c030df91eaa8 | [
"MIT"
] | null | null | null | Homework/Refactoring-Pep8/whitespace_naming_convention2.py | caocmai/SPD-2.31-Testing-and-Architecture | 5e9a86849dff795cc06c7a41af49c030df91eaa8 | [
"MIT"
] | null | null | null | # By Kami Bigdely
# PEP8 - whitespaces and variable names.
class Pizza:
def __init__(self, mybread_type, cheese_type, meat_type, pizza_toppings, size):
self.bread_type = mybread_type
self.cheese_type = cheese_type
self.meat_type = meat_type
self.toppings = pizza_toppings
self... | 36.694444 | 94 | 0.635125 |
1ad2e5ac06704f61255c91ae5d33a06c7e749ac3 | 2,443 | py | Python | fusion.py | zhangshengHust/mlci | 7704116ea928dd6188776463ccf4c33f339330aa | [
"MIT"
] | 1 | 2021-11-29T09:48:40.000Z | 2021-11-29T09:48:40.000Z | fusion.py | zhangshengHust/mlci_tv | 7704116ea928dd6188776463ccf4c33f339330aa | [
"MIT"
] | null | null | null | fusion.py | zhangshengHust/mlci_tv | 7704116ea928dd6188776463ccf4c33f339330aa | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import torch.nn.utils.weight_norm as weight_norm
from fc import FCNet
class BlFusion(nn.Module):
def __init__(self, v_dim=2048, q_dim=1280, h_dim=1280, dropout = [.2, .0], k=5):
super(BlFusion, self).__... | 29.083333 | 84 | 0.542775 |
1ad2f60c0ad8d2caba7e4d4dfa275ccada8eacec | 1,573 | py | Python | regparser/commands/pipeline.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 26 | 2016-06-04T20:48:09.000Z | 2021-07-28T18:13:30.000Z | regparser/commands/pipeline.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 146 | 2016-04-06T19:07:54.000Z | 2022-01-02T20:09:53.000Z | regparser/commands/pipeline.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 28 | 2016-04-09T20:40:48.000Z | 2021-05-08T17:52:59.000Z | import click
from regparser.commands.annual_editions import annual_editions
from regparser.commands.annual_version import annual_version
from regparser.commands.diffs import diffs
from regparser.commands.fill_with_rules import fill_with_rules
from regparser.commands.layers import layers
from regparser.commands.version... | 39.325 | 75 | 0.736809 |
1ad3070d640f446fb4acf37af96f8738d11b5804 | 5,822 | py | Python | vnpy/trader/util_monitor.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | 1 | 2020-03-28T10:09:49.000Z | 2020-03-28T10:09:49.000Z | vnpy/trader/util_monitor.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | null | null | null | vnpy/trader/util_monitor.py | howyu88/vnpy2 | c8ae445823dc1f71abda1a79fae7d4be3dd92dd4 | [
"MIT"
] | 1 | 2020-03-29T06:09:28.000Z | 2020-03-29T06:09:28.000Z | # encoding: UTF-8
# 华富资产
from typing import Dict
from .utility import get_folder_path
from .util_logger import setup_logger
from .event import (
EVENT_TRADE,
EVENT_ORDER,
EVENT_POSITION,
EVENT_ACCOUNT,
EVENT_LOG
)
########################################################################
class Ba... | 30.804233 | 76 | 0.531604 |
1ad318bfbdbb270513730cd6cea6afcf161ad6fc | 302 | py | Python | yggdrasil/communication/WOFOSTParamFileComm.py | Xyzic/yggdrasil | 44369514ffdf01960bfcce418c172dc6dc564051 | [
"BSD-3-Clause"
] | 22 | 2019-02-05T15:20:07.000Z | 2022-02-25T09:00:40.000Z | yggdrasil/communication/WOFOSTParamFileComm.py | Xyzic/yggdrasil | 44369514ffdf01960bfcce418c172dc6dc564051 | [
"BSD-3-Clause"
] | 48 | 2019-02-15T20:41:24.000Z | 2022-03-16T20:52:02.000Z | yggdrasil/communication/WOFOSTParamFileComm.py | Xyzic/yggdrasil | 44369514ffdf01960bfcce418c172dc6dc564051 | [
"BSD-3-Clause"
] | 16 | 2019-04-27T03:36:40.000Z | 2021-12-02T09:47:06.000Z | from yggdrasil.communication import FileComm
class WOFOSTParamFileComm(FileComm.FileComm):
r"""Class for handling I/O from/to a WOFOST parameter file on disk."""
_filetype = 'wofost'
_schema_subtype_description = 'The file is a WOFOST parameter file.'
_default_serializer = 'wofost'
| 30.2 | 74 | 0.751656 |
1ad34b81defb39ce4f5d647620f1ec1ae206780d | 26,310 | py | Python | asprin/src/main/main.py | potassco/asprin | 42e296cdc70cacbbc4d699ef32ec903c83c8208a | [
"MIT"
] | 16 | 2016-11-16T17:24:42.000Z | 2022-01-08T16:19:46.000Z | asprin/src/main/main.py | potassco/asprin | 42e296cdc70cacbbc4d699ef32ec903c83c8208a | [
"MIT"
] | 10 | 2018-03-14T14:18:40.000Z | 2022-01-21T13:24:06.000Z | asprin/src/main/main.py | potassco/asprin | 42e296cdc70cacbbc4d699ef32ec903c83c8208a | [
"MIT"
] | 4 | 2018-03-10T04:25:45.000Z | 2020-10-20T09:43:08.000Z | # MIT License
#
# Copyright (c) 2017 Javier Romero
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge... | 39.924127 | 100 | 0.574496 |
1ad37c22c1de34de60501bcfb93fa27b467e1c82 | 20,461 | py | Python | swift/account/backend.py | sarvesh-ranjan/swift | f436da3b9b3c1a0d6b395378f08be4aa640d8241 | [
"Apache-2.0"
] | 1 | 2015-09-12T08:05:49.000Z | 2015-09-12T08:05:49.000Z | swift/account/backend.py | sarvesh-ranjan/swift | f436da3b9b3c1a0d6b395378f08be4aa640d8241 | [
"Apache-2.0"
] | null | null | null | swift/account/backend.py | sarvesh-ranjan/swift | f436da3b9b3c1a0d6b395378f08be4aa640d8241 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... | 39.5 | 79 | 0.537657 |
1ad3bb808ae01f950357d8e6a015823d3e5065c4 | 3,812 | py | Python | codenerix_lib/pylock.py | codenerix/codenerix-lib | 3507026f95f74ff640fea38d9fda59237efa77e5 | [
"Apache-2.0"
] | 15 | 2018-03-21T10:47:57.000Z | 2022-02-01T08:17:56.000Z | codenerix_lib/pylock.py | codenerix/codenerix-lib | 3507026f95f74ff640fea38d9fda59237efa77e5 | [
"Apache-2.0"
] | 4 | 2018-04-11T10:19:08.000Z | 2020-02-29T18:54:36.000Z | codenerix_lib/pylock.py | codenerix/codenerix-lib | 3507026f95f74ff640fea38d9fda59237efa77e5 | [
"Apache-2.0"
] | 5 | 2018-03-12T16:57:02.000Z | 2021-04-15T16:51:08.000Z | # -*- coding: utf-8 -*-
#
# django-codenerix
#
# Copyright 2017 Centrologic Computational Logistic Center S.L.
#
# Project URL : http://www.codenerix.com
#
# 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 ... | 25.931973 | 110 | 0.60808 |
1ad43c5d2c311740b11440b098d466bd93a2ab45 | 3,528 | py | Python | web/cloudstrype/main/management/commands/fsck.py | btimby/cloudstrype | e465ecbb7e4274be24b181dc6de3eb052d2eb656 | [
"MIT"
] | 5 | 2017-03-13T17:04:55.000Z | 2017-06-14T22:55:45.000Z | web/cloudstrype/main/management/commands/fsck.py | btimby/cloudstrype | e465ecbb7e4274be24b181dc6de3eb052d2eb656 | [
"MIT"
] | 16 | 2017-02-24T06:41:27.000Z | 2017-03-08T06:21:51.000Z | web/cloudstrype/main/management/commands/fsck.py | btimby/cloudstrype | e465ecbb7e4274be24b181dc6de3eb052d2eb656 | [
"MIT"
] | null | null | null | import logging
from hashlib import md5, sha1
from django.core.management.base import BaseCommand
from main.fs import get_fs
from main.models import User, File
LOGGER = logging.getLogger(__name__)
LOGGER.addHandler(logging.NullHandler())
class Command(BaseCommand):
help = """File System ChecK.
Checks int... | 34.252427 | 79 | 0.539966 |
1ad44d194adda7a0e4d1f54148718975b31df44a | 2,597 | py | Python | mitmproxy/net/dns/types.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | mitmproxy/net/dns/types.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | mitmproxy/net/dns/types.py | fedosgad/mitmproxy | 7eacc41f3b1079e000cf6b6c19c0f337d6e01177 | [
"MIT"
] | null | null | null | A = 1
NS = 2
MD = 3
MF = 4
CNAME = 5
SOA = 6
MB = 7
MG = 8
MR = 9
NULL = 10
WKS = 11
PTR = 12
HINFO = 13
MINFO = 14
MX = 15
TXT = 16
RP = 17
AFSDB = 18
X25 = 19
ISDN = 20
RT = 21
NSAP = 22
NSAP_PTR = 23
SIG = 24
KEY = 25
PX = 26
GPOS = 27
AAAA = 28
LOC = 29
NXT = 30
EID = 31
NIMLOC = 32
SRV = 33
ATMA = 34
NAPTR = 35
KX... | 13.962366 | 46 | 0.505583 |
1ad45407435eb0618eeda1ef158a5696992f1ff6 | 1,900 | py | Python | authors/apps/authentication/migrations/0001_initial.py | andela/ah-backend-prime | 0708463d4565a4977a5a5dcb839f1dfed52fdc90 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/authentication/migrations/0001_initial.py | andela/ah-backend-prime | 0708463d4565a4977a5a5dcb839f1dfed52fdc90 | [
"BSD-3-Clause"
] | 22 | 2019-03-25T16:10:53.000Z | 2022-03-11T23:44:21.000Z | authors/apps/authentication/migrations/0001_initial.py | andela/ah-backend-prime | 0708463d4565a4977a5a5dcb839f1dfed52fdc90 | [
"BSD-3-Clause"
] | 6 | 2019-03-25T09:39:39.000Z | 2021-03-11T23:54:12.000Z |
# Generated by Django 2.1.7 on 2019-04-17 11:01
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50 | 266 | 0.64 |
1ad478a2b9b2391eb4bc71b7841e050e80389339 | 633 | py | Python | eb-virt/bin/rst2man.py | YutingPang/one_note | 9dfc7061f07819cbac96e87080d767705d7dfe0c | [
"MIT"
] | null | null | null | eb-virt/bin/rst2man.py | YutingPang/one_note | 9dfc7061f07819cbac96e87080d767705d7dfe0c | [
"MIT"
] | null | null | null | eb-virt/bin/rst2man.py | YutingPang/one_note | 9dfc7061f07819cbac96e87080d767705d7dfe0c | [
"MIT"
] | null | null | null | #!/Users/yutingpang/git/eb-flask/eb-virt/bin/python
# Author:
# Contact: grubert@users.sf.net
# Copyright: This module has been placed in the public domain.
"""
man.py
======
This module provides a simple command line interface that uses the
man page writer to output from ReStructuredText source.
"""
import locale... | 23.444444 | 80 | 0.767773 |
1ad49444113df5171de3a7d528431849ddad5096 | 921 | py | Python | setup.py | ramwin/django-coupons | 1bcd18e31901c17051e007b201304821419e7628 | [
"BSD-3-Clause"
] | null | null | null | setup.py | ramwin/django-coupons | 1bcd18e31901c17051e007b201304821419e7628 | [
"BSD-3-Clause"
] | null | null | null | setup.py | ramwin/django-coupons | 1bcd18e31901c17051e007b201304821419e7628 | [
"BSD-3-Clause"
] | null | null | null | import os
from setuptools import setup, find_packages
import coupons
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='django2-coupons',
version=coupons.__version__,
description='A reuseable Django application for coupon gereration and handling.',
... | 26.314286 | 85 | 0.649294 |
1ad51d42d6d626774712e7fafda721157fc8fa73 | 1,305 | py | Python | 01-Lesson-Plans/02-Python/3/Activities/03-Ins_Time_Value_of_Money/Solved/time_value.py | tatianegercina/FinTech | b40687aa362d78674e223eb15ecf14bc59f90b62 | [
"ADSL"
] | 1 | 2021-04-13T07:14:34.000Z | 2021-04-13T07:14:34.000Z | 01-Lesson-Plans/02-Python/3/Activities/03-Ins_Time_Value_of_Money/Solved/time_value.py | tatianegercina/FinTech | b40687aa362d78674e223eb15ecf14bc59f90b62 | [
"ADSL"
] | 2 | 2021-06-02T03:14:19.000Z | 2022-02-11T23:21:24.000Z | 01-Lesson-Plans/02-Python/3/Activities/03-Ins_Time_Value_of_Money/Solved/time_value.py | tatianegercina/FinTech | b40687aa362d78674e223eb15ecf14bc59f90b62 | [
"ADSL"
] | 1 | 2021-05-07T13:26:50.000Z | 2021-05-07T13:26:50.000Z | # -*- coding: utf-8 -*-
"""
Instructor Demo: Time Value of Money Functions.
This script contains functions that can calculate future values and present values.
"""
def calculate_future_value(present_value, interest_rate, compounding_periods, years):
"""
Calculates the future value of money given the present_va... | 34.342105 | 186 | 0.745594 |
1ad545289a4fcf74b33e14b6477a47afde67c310 | 1,006 | py | Python | leetcode/1-easy/2-string/4-validanagram/valid_anagram.py | ai7/study | be490336dc70ade62a8ff8d7866af7ac52bef4c1 | [
"MIT"
] | null | null | null | leetcode/1-easy/2-string/4-validanagram/valid_anagram.py | ai7/study | be490336dc70ade62a8ff8d7866af7ac52bef4c1 | [
"MIT"
] | null | null | null | leetcode/1-easy/2-string/4-validanagram/valid_anagram.py | ai7/study | be490336dc70ade62a8ff8d7866af7ac52bef4c1 | [
"MIT"
] | null | null | null | # https://leetcode.com/explore/interview/card/top-interview-questions-easy/127/strings/882/
# https://leetcode.com/problems/valid-anagram/description/
# Valid Anagram
#
# Given two strings s and t , write a function to determine if t is an
# anagram of s.
import collections
class Solution:
# Note: check sorted... | 21.404255 | 91 | 0.575547 |
1ad550410e0c5c00f08fe3fcb21387f5c538115c | 9,892 | py | Python | batchglm/train/tf/base_glm_all/jacobians.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/train/tf/base_glm_all/jacobians.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/train/tf/base_glm_all/jacobians.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | import logging
from typing import List
import tensorflow as tf
from .external import ModelVarsGLM, JacobiansGLM
from .external import op_utils
from .external import pkg_constants
logger = logging.getLogger(__name__)
class JacobiansGLMALL(JacobiansGLM):
"""
Compute the Jacobian matrix for a GLM using gradie... | 38.792157 | 111 | 0.584412 |
1ad563747a2aa8b1b3d3ba8932b86d9d387adef2 | 2,843 | py | Python | alipay/aop/api/domain/AlipayOpenMiniShopRelationQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOpenMiniShopRelationQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOpenMiniShopRelationQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenMiniShopRelationQueryModel(object):
def __init__(self):
self._entity_id_list = None
self._operation = None
self._page_num = None
self._page_size = None
... | 30.244681 | 79 | 0.58389 |
1ad56e630939936c84d7f4200144285955c36ee1 | 2,383 | py | Python | DataProcessor/gen_data_neural.py | INK-USC/shifted-label-distribution | 3cf2b7ced3b2e18234db405f6014f049c4830d71 | [
"Apache-2.0"
] | 37 | 2019-10-29T13:12:41.000Z | 2022-01-20T02:42:28.000Z | DataProcessor/gen_data_neural.py | INK-USC/shifted-label-distribution | 3cf2b7ced3b2e18234db405f6014f049c4830d71 | [
"Apache-2.0"
] | 5 | 2020-07-23T10:32:59.000Z | 2021-09-01T11:37:15.000Z | DataProcessor/gen_data_neural.py | INK-USC/shifted-label-distribution | 3cf2b7ced3b2e18234db405f6014f049c4830d71 | [
"Apache-2.0"
] | 2 | 2020-05-27T06:00:56.000Z | 2021-02-08T10:45:41.000Z | '''
Prepare data for neural models
Author: Maosen Zhang / Qinyuan Ye
'''
from tqdm import tqdm
import os
import json
import argparse
rel_list = ['no_relation']
def find_index(sen_split, word_split):
index1 = -1
index2 = -1
for i in range(len(sen_split)):
if str(sen_split[i]) == str(word_split[0]):
flag = Tru... | 26.775281 | 80 | 0.624423 |
1ad57c13c90b125a6cd94d4a32149ca84583fb44 | 2,208 | py | Python | composed_configuration/_base.py | waxlamp/django-composed-configuration | c009bf12ccdfa73d8fd21807f4d41bad14f1790b | [
"Apache-2.0"
] | null | null | null | composed_configuration/_base.py | waxlamp/django-composed-configuration | c009bf12ccdfa73d8fd21807f4d41bad14f1790b | [
"Apache-2.0"
] | null | null | null | composed_configuration/_base.py | waxlamp/django-composed-configuration | c009bf12ccdfa73d8fd21807f4d41bad14f1790b | [
"Apache-2.0"
] | null | null | null | from typing import Type
from configurations import Configuration, values
from configurations.base import ConfigurationBase
# With the default "late_binding=False", and "environ_name" is specified or "environ=False",
# even Values from non-included classes (e.g. `AWS_DEFAULT_REGION) get immediately evaluated and
# exp... | 34.5 | 97 | 0.717391 |
1ad58eee2ccea126fe2cdf88a2290a125d998402 | 668 | py | Python | zaailabcorelib/ztools/helper.py | chiutuanbinh/zaailabcorelib | 1967ebcd6e12f0c38ea03c827e16745cb8e0569c | [
"MIT"
] | 1 | 2019-11-26T07:12:31.000Z | 2019-11-26T07:12:31.000Z | zaailabcorelib/ztools/helper.py | chiutuanbinh/zaailabcorelib | 1967ebcd6e12f0c38ea03c827e16745cb8e0569c | [
"MIT"
] | null | null | null | zaailabcorelib/ztools/helper.py | chiutuanbinh/zaailabcorelib | 1967ebcd6e12f0c38ea03c827e16745cb8e0569c | [
"MIT"
] | 3 | 2019-12-05T14:54:03.000Z | 2021-05-15T15:03:48.000Z | import os
def get_tf_env(gpu_id=-1, mem_fraction=0):
''' Get Tensorflow environment
Return:
tf, config
'''
if isinstance(gpu_id, str):
gpu_id = int(gpu_id)
if gpu_id != -1:
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVIC... | 25.692308 | 80 | 0.601796 |
1ad595d459dfdd57c2f16eaac5638ec116246021 | 18,999 | py | Python | src/python/pants/backend/jvm/subsystems/zinc.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/subsystems/zinc.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | src/python/pants/backend/jvm/subsystems/zinc.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from hashlib import sha1
from pathlib import Path
from threading import Lock
from typing import cast
from pants.backend.jvm.subsystems.dependency_context import DependencyContex... | 43.575688 | 160 | 0.693247 |
1ad5a2202af8ee52c99a153b44c68ad62420c839 | 120 | py | Python | demos/10-graphical-ui/data-conversion-demo/source/loaders/formats.py | sk-dwtoulouse/python-initiation-training | f3883a2ba1fecb615173f27000e5ad944f11ff3f | [
"MIT"
] | 1 | 2021-06-23T06:55:12.000Z | 2021-06-23T06:55:12.000Z | demos/10-graphical-ui/data-conversion-demo/source/loaders/formats.py | sk-dwtoulouse/python-initiation-training | f3883a2ba1fecb615173f27000e5ad944f11ff3f | [
"MIT"
] | null | null | null | demos/10-graphical-ui/data-conversion-demo/source/loaders/formats.py | sk-dwtoulouse/python-initiation-training | f3883a2ba1fecb615173f27000e5ad944f11ff3f | [
"MIT"
] | 2 | 2021-06-23T12:36:34.000Z | 2021-09-09T14:21:24.000Z | from enum import IntEnum
class DataFormat(IntEnum):
"""Supported formats enumeration."""
CSV = 0
TEXT = 1
| 15 | 40 | 0.658333 |
1ad5c3ae0c89df5cf4ed69efc86acbeca565e845 | 1,707 | py | Python | ForgeUserStats/setup.py | shalithasuranga/allura | 4f7fba13415954d07f602a051ec697329dd3706b | [
"Apache-2.0"
] | 1 | 2017-07-31T23:13:58.000Z | 2017-07-31T23:13:58.000Z | ForgeUserStats/setup.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | ForgeUserStats/setup.py | DalavanCloud/allura | a25329caed9e6d136a1004c33372e0632a16e352 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 33.470588 | 79 | 0.652607 |
1ad5db122a942881bd15e968acb89782b48213d7 | 433 | py | Python | pagesext/migrations/__init__.py | dlancer/django-pages-cms-extensions | 4aa6f2780abef9543ced20258ede01a9662167b3 | [
"BSD-3-Clause"
] | 1 | 2016-07-08T07:23:20.000Z | 2016-07-08T07:23:20.000Z | pagesext/migrations/__init__.py | dlancer/django-pages-cms-extensions | 4aa6f2780abef9543ced20258ede01a9662167b3 | [
"BSD-3-Clause"
] | null | null | null | pagesext/migrations/__init__.py | dlancer/django-pages-cms-extensions | 4aa6f2780abef9543ced20258ede01a9662167b3 | [
"BSD-3-Clause"
] | null | null | null | """
Django migrations for pages app
This package does not contain South migrations.
"""
SOUTH_ERROR_MESSAGE = """\n
South migrations not supported!
"""
# Ensure the user is not using Django 1.6 or below with South
try:
# noinspection PyUnresolvedReferences
from django.db import migrations
except ImportError:... | 24.055556 | 61 | 0.778291 |
1ad5dd2ad45e0f8f24fc2eb74b086d99e77ac8b0 | 263 | py | Python | setup.py | aaronfraint/philly-transit-data | f505746354fc21760f53660af672b861031622e2 | [
"MIT"
] | null | null | null | setup.py | aaronfraint/philly-transit-data | f505746354fc21760f53660af672b861031622e2 | [
"MIT"
] | null | null | null | setup.py | aaronfraint/philly-transit-data | f505746354fc21760f53660af672b861031622e2 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name='philly_transit_data',
packages=find_packages(),
version='0.0.3',
description='Download SEPTA, NJ Transit, and PATCO data from the web',
author='Aaron Fraint, AICP',
license='MIT',
) | 26.3 | 74 | 0.695817 |
1ad5fa995016e3f315e9ab91a84f8a013bb32ffa | 4,163 | py | Python | gwlfe/AFOS/nonGrazingAnimals/Losses/NGLostBarnN.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | gwlfe/AFOS/nonGrazingAnimals/Losses/NGLostBarnN.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | gwlfe/AFOS/nonGrazingAnimals/Losses/NGLostBarnN.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | from numpy import maximum
from numpy import repeat
from numpy import reshape
from numpy import sum
from numpy import where
from numpy import zeros
from gwlfe.AFOS.nonGrazingAnimals.Loads.NGInitBarnN import NGInitBarnN
from gwlfe.AFOS.nonGrazingAnimals.Loads.NGInitBarnN import NGInitBarnN_f
from gwlfe.Memoization impor... | 51.395062 | 120 | 0.705741 |
1ad5ff9410ab9be1ecddc9a91297c451827397b2 | 25,795 | py | Python | synapse/api/auth.py | xorob0/synapse | 13782c2680615eef66301e06e7775761e64ea36a | [
"Apache-2.0"
] | null | null | null | synapse/api/auth.py | xorob0/synapse | 13782c2680615eef66301e06e7775761e64ea36a | [
"Apache-2.0"
] | null | null | null | synapse/api/auth.py | xorob0/synapse | 13782c2680615eef66301e06e7775761e64ea36a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 - 2016 OpenMarket 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 applic... | 38.442623 | 87 | 0.609731 |
1ad60f93adc803343f390bd387c1559bcf72e4be | 63,142 | py | Python | nova/db/sqlalchemy/migrate_repo/versions/216_havana.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/db/sqlalchemy/migrate_repo/versions/216_havana.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | null | null | null | nova/db/sqlalchemy/migrate_repo/versions/216_havana.py | ebalduf/nova-backports | 6bf97ec73467de522d34ab7a17ca0e0874baa7f9 | [
"Apache-2.0"
] | 1 | 2020-07-24T01:18:44.000Z | 2020-07-24T01:18:44.000Z | # Copyright 2012 OpenStack Foundation
#
# 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 ... | 40.710509 | 79 | 0.621441 |
1ad6240446422e85e38783eb227511bc1ffa6ffa | 8,950 | py | Python | QUANTAXIS_Monitor_GUI/MainTabWindows/Tab06_ForecastStockTrends.py | simplezhang57/QUANTAXIS | 0fab23ee3cc4048a30b5eed3c311a5c9cdce8110 | [
"MIT"
] | 2 | 2018-10-29T12:01:55.000Z | 2021-03-05T10:28:59.000Z | QUANTAXIS_Monitor_GUI/MainTabWindows/Tab06_ForecastStockTrends.py | frosthaoz/QUANTAXIS | f5f482418e5f6e23ac3530089b8d17300d931b48 | [
"MIT"
] | null | null | null | QUANTAXIS_Monitor_GUI/MainTabWindows/Tab06_ForecastStockTrends.py | frosthaoz/QUANTAXIS | f5f482418e5f6e23ac3530089b8d17300d931b48 | [
"MIT"
] | 2 | 2018-11-30T07:52:14.000Z | 2021-05-28T23:00:20.000Z | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# 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 th... | 33.901515 | 89 | 0.56067 |
1ad64f1124022a4a444ac9169f06dd3c8ab4ce56 | 14,940 | py | Python | robot_sim/robots/sda5f/sda5f.py | wanweiwei07/wrs | 830da245ad2beb4c2daa2342861fb79fc6229d83 | [
"MIT"
] | 23 | 2021-04-02T09:02:04.000Z | 2022-03-22T05:31:03.000Z | robot_sim/robots/sda5f/sda5f.py | wanweiwei07/wrs | 830da245ad2beb4c2daa2342861fb79fc6229d83 | [
"MIT"
] | 35 | 2021-04-12T09:41:05.000Z | 2022-03-26T13:32:46.000Z | robot_sim/robots/sda5f/sda5f.py | wanweiwei07/wrs | 830da245ad2beb4c2daa2342861fb79fc6229d83 | [
"MIT"
] | 16 | 2021-03-30T11:55:45.000Z | 2022-03-30T07:10:59.000Z | import os
import math
import numpy as np
import basis.robot_math as rm
import modeling.model_collection as mc
import modeling.collision_model as cm
import robot_sim._kinematics.jlchain as jl
import robot_sim.manipulators.sia5.sia5 as sia
import robot_sim.end_effectors.grippers.robotiq85.robotiq85 as rtq
from panda3d.co... | 50.30303 | 119 | 0.574029 |
1ad66246742f003ab5544bb23ba756a2b8edb90f | 951 | py | Python | Basic-CNN/mnist.py | ujjwal190/Machine_Learning | fc7fcc7089179d5e8f2b06c2b40a857eb32b97cf | [
"Unlicense"
] | null | null | null | Basic-CNN/mnist.py | ujjwal190/Machine_Learning | fc7fcc7089179d5e8f2b06c2b40a857eb32b97cf | [
"Unlicense"
] | null | null | null | Basic-CNN/mnist.py | ujjwal190/Machine_Learning | fc7fcc7089179d5e8f2b06c2b40a857eb32b97cf | [
"Unlicense"
] | null | null | null | #encoding=utf-8
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets('MNIST_data/',one_hot=True)
sess = tf.InteractiveSession()
#real data
x = tf.placeholder(tf.float32,[None,784])
y_ = tf.placeholder(tf.float32,[None,10])
W = tf.Variable(tf.zeros([784,10... | 33.964286 | 82 | 0.757098 |
1ad664dabf7fa9e30b7a7a02304a8d9a4ded5e8f | 2,470 | py | Python | venv/Lib/site-packages/pyrogram/raw/functions/bots/send_custom_request.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/functions/bots/send_custom_request.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/functions/bots/send_custom_request.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.666667 | 103 | 0.62753 |
1ad67b1e1ebf41da02eded07bed2171bb0d96368 | 98 | py | Python | marshmallow_jsonapi/__init__.py | jnetod/marshmallow-jsonapi | 382deda60f5efb02ce128aade3b9379f01843304 | [
"MIT"
] | null | null | null | marshmallow_jsonapi/__init__.py | jnetod/marshmallow-jsonapi | 382deda60f5efb02ce128aade3b9379f01843304 | [
"MIT"
] | null | null | null | marshmallow_jsonapi/__init__.py | jnetod/marshmallow-jsonapi | 382deda60f5efb02ce128aade3b9379f01843304 | [
"MIT"
] | null | null | null | from .schema import Schema, SchemaOpts
__version__ = "0.23.2"
__all__ = ("Schema", "SchemaOpts")
| 19.6 | 38 | 0.714286 |
1ad6fa44a88921e32e1abb6e5845ff7f02930b4c | 2,231 | py | Python | field_history/models.py | grantmcconnaughey/django-field-history | 84cda9d5d49d5ea6220ab1c82878c37280490a6b | [
"BSD-3-Clause"
] | 346 | 2016-02-17T22:29:55.000Z | 2022-03-20T17:43:26.000Z | field_history/models.py | grantmcconnaughey/django-field-history | 84cda9d5d49d5ea6220ab1c82878c37280490a6b | [
"BSD-3-Clause"
] | 36 | 2016-02-18T18:41:11.000Z | 2021-09-17T05:48:36.000Z | field_history/models.py | grantmcconnaughey/django-field-history | 84cda9d5d49d5ea6220ab1c82878c37280490a6b | [
"BSD-3-Clause"
] | 42 | 2016-02-19T18:20:47.000Z | 2020-09-11T01:31:52.000Z | # -*- coding: utf-8 -*-
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.core import serializers
from django.db import models
from .managers import FieldHistoryManager
OBJECT_ID_TYPE_SETTING = 'FIELD_HISTORY_OBJECT_ID_TYPE'
def instantiate_object_id_field... | 39.140351 | 117 | 0.748991 |
1ad7010ffc0d0a36ebca2b637ccb979a53af5c05 | 18,204 | py | Python | albert_baseline.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 8 | 2022-03-01T09:02:44.000Z | 2022-03-18T14:41:56.000Z | albert_baseline.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 1 | 2022-03-09T12:12:22.000Z | 2022-03-10T09:08:42.000Z | albert_baseline.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 2 | 2022-03-02T01:46:52.000Z | 2022-03-02T13:51:53.000Z | #!/usr/bin/env python
# coding=utf-8
# Copyright The HuggingFace Team and The HuggingFace Inc. team. 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.ap... | 42.236659 | 132 | 0.673368 |
1ad70921797b3af299a8312b75a2d601b189733b | 370 | py | Python | master/bopytest-code/code/appendices/packaging/some_package_proj_v2/setup.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 4 | 2018-09-07T15:35:24.000Z | 2019-03-27T09:48:12.000Z | master/bopytest-code/code/appendices/packaging/some_package_proj_v2/setup.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 371 | 2020-03-04T21:51:56.000Z | 2022-03-31T20:59:11.000Z | master/bopytest-code/code/appendices/packaging/some_package_proj_v2/setup.py | AlexRogalskiy/DevArtifacts | 931aabb8cbf27656151c54856eb2ea7d1153203a | [
"MIT"
] | 3 | 2019-06-18T19:57:17.000Z | 2020-11-06T03:55:08.000Z | from setuptools import setup, find_packages
setup(
name='some_package',
description='Demonstrate packaging and distribution',
version='1.0',
author='Brian Okken',
author_email='brian@pthontesting.net',
url='https://pragprog.com/book/bopytest/python-testing-with-pytest',
packages=find_pack... | 24.666667 | 72 | 0.7 |
1ad73ad6730e86e4547351c91dfd556af9b1f740 | 6,233 | py | Python | src/encoder_module.py | ShaneTian/Att-Induction | 9ae11ee30485181b9014b15ac927eb8b2a4170be | [
"Apache-2.0"
] | 40 | 2020-05-09T12:35:16.000Z | 2022-03-03T02:58:00.000Z | src/encoder_module.py | ShaneTian/Att-Induction | 9ae11ee30485181b9014b15ac927eb8b2a4170be | [
"Apache-2.0"
] | 7 | 2020-06-09T01:30:47.000Z | 2022-01-04T09:14:27.000Z | src/encoder_module.py | ShaneTian/Att-Induction | 9ae11ee30485181b9014b15ac927eb8b2a4170be | [
"Apache-2.0"
] | 2 | 2021-02-24T11:25:04.000Z | 2021-03-13T02:20:59.000Z | import os
import json
import math
import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
from transformers import BertModel, BertTokenizer
class AttBiLSTMEncoder(nn.Module):
"""Encoder indices of sentences by Self-Attention Bi-LSTM."""
def __init__(self, pretrain_path, max... | 36.881657 | 108 | 0.572437 |
1ad74bf3090a85350ccea2bde1dcccfdb40e206b | 1,958 | py | Python | project_euler/problem_01/sol3.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | project_euler/problem_01/sol3.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | null | null | null | project_euler/problem_01/sol3.py | tg12/Python | 398d1dbf4b780d1725aeae9a91b4c79f4410e2f0 | [
"MIT"
] | 1 | 2020-06-26T09:46:17.000Z | 2020-06-26T09:46:17.000Z | '''THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE
DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OT... | 24.78481 | 76 | 0.590398 |
1ad7523f1f01c53703d41acc78637b739f5c148f | 12,137 | py | Python | satgenpy/satgen/dynamic_state/generate_dynamic_state.py | patrickkon/hypatia | 3cbcaa9a5f377141628b4b3ef2808e1fe3e4b388 | [
"MIT"
] | null | null | null | satgenpy/satgen/dynamic_state/generate_dynamic_state.py | patrickkon/hypatia | 3cbcaa9a5f377141628b4b3ef2808e1fe3e4b388 | [
"MIT"
] | null | null | null | satgenpy/satgen/dynamic_state/generate_dynamic_state.py | patrickkon/hypatia | 3cbcaa9a5f377141628b4b3ef2808e1fe3e4b388 | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2020 ETH Zurich
#
# 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... | 41.142373 | 179 | 0.650408 |
1ad766928bf8965dd2af81ff2ace164a694c405c | 4,923 | py | Python | torchfunction/nn/linear.py | sillybun/pyctlib | d4c8b191fd270923ad73924760847f2bdbdd9116 | [
"MIT"
] | 3 | 2021-07-03T17:27:44.000Z | 2021-09-26T20:48:19.000Z | torchfunction/nn/linear.py | sillybun/pyctlib | d4c8b191fd270923ad73924760847f2bdbdd9116 | [
"MIT"
] | null | null | null | torchfunction/nn/linear.py | sillybun/pyctlib | d4c8b191fd270923ad73924760847f2bdbdd9116 | [
"MIT"
] | 1 | 2022-03-08T08:54:03.000Z | 2022-03-08T08:54:03.000Z | from torch import nn
from torch.nn.parameter import Parameter
import torch
from torch import Tensor
import torch.nn.init as init
import torch.nn.functional as F
from pyctlib import vector, touch
def identity(x):
return x
def get_activation_layer(activation):
if isinstance(activation, nn.Module):
retur... | 40.02439 | 210 | 0.594759 |
1ad76f937cb626a4363b0aa3b545135dd52896a2 | 2,236 | py | Python | ninecms/utils/sanitize.py | Wtower/django-ninecms | e500010fb11f06c8dfe8d8c9c4d2aab0b15bc127 | [
"BSD-3-Clause"
] | 49 | 2015-11-17T16:18:02.000Z | 2021-12-10T15:01:03.000Z | ninecms/utils/sanitize.py | Wtower/django-ninecms | e500010fb11f06c8dfe8d8c9c4d2aab0b15bc127 | [
"BSD-3-Clause"
] | 39 | 2015-11-18T12:20:14.000Z | 2022-01-19T10:47:19.000Z | ninecms/utils/sanitize.py | Wtower/django-ninecms | e500010fb11f06c8dfe8d8c9c4d2aab0b15bc127 | [
"BSD-3-Clause"
] | 9 | 2016-04-07T12:12:05.000Z | 2021-02-04T15:42:02.000Z | """ Sanitize text input """
__author__ = 'George Karakostas'
__copyright__ = 'Copyright 2015, George Karakostas'
__licence__ = 'BSD-3'
__email__ = 'gkarak@9-dev.com'
from django.utils.html import strip_tags
from django import forms
import bleach
def sanitize(t, allow_html=True, full_html=False):
""" Bleach clean... | 39.928571 | 103 | 0.580948 |
1ad776306311eae002b54b1a8b5e7c57bfca2043 | 4,367 | py | Python | FinanceAnalysisAlgoTrading/08-Time-Series-Analysis_02-EWMA-Exponentially-weighted-moving-average.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 2 | 2020-03-04T11:18:38.000Z | 2020-05-10T15:36:42.000Z | FinanceAnalysisAlgoTrading/08-Time-Series-Analysis_02-EWMA-Exponentially-weighted-moving-average.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 6 | 2020-03-30T16:42:47.000Z | 2021-12-13T20:37:21.000Z | FinanceAnalysisAlgoTrading/08-Time-Series-Analysis_02-EWMA-Exponentially-weighted-moving-average.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 1 | 2020-04-14T11:26:16.000Z | 2020-04-14T11:26:16.000Z | #!/usr/bin/env python
# coding: utf-8
# ___
#
# <a href='http://www.pieriandata.com'> <img src='../Pierian_Data_Logo.png' /></a>
# ___
# <center>*Copyright Pierian Data 2017*</center>
# <center>*For more information, visit us at www.pieriandata.com*</center>
# In[19]:
import pandas as pd
import numpy as np
import matp... | 49.067416 | 343 | 0.691321 |
1ad77c9756435917df38fd13b194e7e3a0aee06b | 129 | py | Python | yarn/datadog_checks/yarn/__about__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2020-08-08T02:01:01.000Z | 2020-08-08T02:01:01.000Z | yarn/datadog_checks/yarn/__about__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 4 | 2019-07-03T02:53:19.000Z | 2019-07-10T14:52:14.000Z | yarn/datadog_checks/yarn/__about__.py | seants/integrations-core | 1e5548915fc24f1bbd095e845f0940c22992b09c | [
"BSD-3-Clause"
] | 1 | 2019-03-06T14:30:52.000Z | 2019-03-06T14:30:52.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
__version__ = "1.4.0"
| 25.8 | 59 | 0.713178 |
1ad780eb1522c2805f0b1fc6c2fdbafab5eef66d | 602 | py | Python | systems/playout/pb_system_1_5_b2.py | Julian-Theis/AVATAR | 24fcd6eaa26f413be528a160d865d5d7e49a780b | [
"MIT"
] | 7 | 2020-12-22T12:09:14.000Z | 2022-03-29T12:50:35.000Z | systems/playout/pb_system_1_5_b2.py | ProminentLab/AVATAR | a20c767d8739a52f538927b4ec3d528952263d5a | [
"MIT"
] | 10 | 2020-11-13T17:45:59.000Z | 2022-02-10T00:50:38.000Z | systems/playout/pb_system_1_5_b2.py | ProminentLab/AVATAR | a20c767d8739a52f538927b4ec3d528952263d5a | [
"MIT"
] | 2 | 2020-03-26T22:27:27.000Z | 2020-07-07T22:36:41.000Z | from util.playout import biased_playout_b2
import os
from conf.settings import DATA_PATH
WORK_PATH = os.path.abspath(os.getcwd())
if __name__ == "__main__":
pn = "data/systems/pb_system_1_5.pnml"
f_pop = "data/variants/pb_system_1_5_b2_pop.txt"
f_train = "data/variants/pb_system_1_5_b2_train.txt"
f_t... | 40.133333 | 115 | 0.774086 |
1ad78ab3786effbec469ccc7b0658033ba9e6591 | 3,827 | py | Python | shadowreader/libs/lambda_init.py | luckymike/shadowreader | 831fe8fbc8f980337285caabe24512b6ba73be11 | [
"Apache-2.0"
] | null | null | null | shadowreader/libs/lambda_init.py | luckymike/shadowreader | 831fe8fbc8f980337285caabe24512b6ba73be11 | [
"Apache-2.0"
] | null | null | null | shadowreader/libs/lambda_init.py | luckymike/shadowreader | 831fe8fbc8f980337285caabe24512b6ba73be11 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2018 Edmunds.com, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... | 30.133858 | 105 | 0.679645 |
1ad78f3f107c64671837f8f9519f055d4fa1896c | 11,286 | py | Python | qnarre/prep/config/marian.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/prep/config/marian.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | qnarre/prep/config/marian.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | # Copyright 2022 Quantapix 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 l... | 34.726154 | 96 | 0.533581 |
1ad7a1731e91948cd5e2389c33e7a31da826c5bf | 5,561 | py | Python | scripts/submit.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 11 | 2018-09-07T11:33:23.000Z | 2022-01-07T12:16:11.000Z | scripts/submit.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 102 | 2018-03-22T15:35:26.000Z | 2022-03-23T17:46:16.000Z | scripts/submit.py | kevinrue/cgat-flow | 02b5a1867253c2f6fd6b4f3763e0299115378913 | [
"MIT"
] | 7 | 2018-06-11T15:01:41.000Z | 2020-03-31T09:29:33.000Z | '''submit.py - run a collection of qsub scripts on the cluster
===========================================================
Purpose
-------
This script will submit a collection of qsub scripts on the cluster.
The script will only submit those jobs for which a result is not
present.
Usage
-----
For example::
pyt... | 28.372449 | 78 | 0.45909 |
1ad7c9f0938ac4a530bc2b04354c0d6d45652c71 | 11,630 | py | Python | HQ-Ensemble.py | git-disl/HQ-Ensemble | c588f2979476e50efd429c9d9d5bb2f854b9ad41 | [
"Apache-2.0"
] | 1 | 2022-03-13T17:43:55.000Z | 2022-03-13T17:43:55.000Z | HQ-Ensemble.py | git-disl/HQ-Ensemble | c588f2979476e50efd429c9d9d5bb2f854b9ad41 | [
"Apache-2.0"
] | null | null | null | HQ-Ensemble.py | git-disl/HQ-Ensemble | c588f2979476e50efd429c9d9d5bb2f854b9ad41 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import os
import time
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torchvision.transforms as transforms
import torchvision.datasets as datasets
from collections import Counter
f... | 41.3879 | 171 | 0.700774 |
1ad7d80b49e1a9914ff4724fc560df7b0fb961a3 | 392 | py | Python | Python-code-snippets-001-100/045-kill running programs.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-001-100/045-kill running programs.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-001-100/045-kill running programs.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | '''45-Kill Running Programs'''
import os
# Try to kill some common windows programs
# Add or remove programs you want by listing
# them by their executable filename.
# To test this example, open notepad and run this code.
os.system("taskkill /f /im notepad.exe")
#os.system("taskkill /f /im winword.exe")
#os.system(... | 26.133333 | 55 | 0.72449 |
1ad7df648de9f2b93eda572a72a34244cad3479f | 859 | py | Python | leetcode/206.reverse-linked-list.py | schio/algorithm_test | c240faca428a9adb2970591338d4792b2f4fb7f3 | [
"MIT"
] | null | null | null | leetcode/206.reverse-linked-list.py | schio/algorithm_test | c240faca428a9adb2970591338d4792b2f4fb7f3 | [
"MIT"
] | null | null | null | leetcode/206.reverse-linked-list.py | schio/algorithm_test | c240faca428a9adb2970591338d4792b2f4fb7f3 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=206 lang=python3
#
# [206] Reverse Linked List
#
# @lc code=start
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def reverseList(self, head: ListNode) -> ListNode:
... | 23.861111 | 56 | 0.534342 |
1ad7f071bda4c813adba94eff28c3308acc67601 | 2,351 | py | Python | sdk/textanalytics/azure-ai-textanalytics/samples/sample_alternative_document_input.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/textanalytics/azure-ai-textanalytics/samples/sample_alternative_document_input.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/samples/sample_alternative_document_input.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"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.
# --------------------------------------------------------------------------
"""
FILE:... | 39.183333 | 223 | 0.656742 |
1ad8126ee5f8740b7d4484bbd8af72592c72a94f | 3,734 | py | Python | intersight/models/networkconfig_validation_task_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/networkconfig_validation_task_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/networkconfig_validation_task_ref.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 pprint import pformat
from six import iteritems
import re
class NetworkconfigValidationTaskRef(object):
"""
N... | 24.893333 | 83 | 0.556776 |
1ad817f290a26a9d014facb4a4ccb3e01d34d16a | 939 | py | Python | tests/test_types/test_files.py | Appuxif/pytdjson | 3896215ca9b34d2bb3c17ff87f959bb7a58437df | [
"MIT"
] | null | null | null | tests/test_types/test_files.py | Appuxif/pytdjson | 3896215ca9b34d2bb3c17ff87f959bb7a58437df | [
"MIT"
] | null | null | null | tests/test_types/test_files.py | Appuxif/pytdjson | 3896215ca9b34d2bb3c17ff87f959bb7a58437df | [
"MIT"
] | null | null | null | from copy import deepcopy
from unittest import TestCase
from telegram.types.files import File
file_dict_base = {
'@type': 'file',
'id': 1,
'size': 0,
'expected_size': 100,
'local': {
'path': 'local-path',
'can_be_downloaded': True,
'can_be_deleted': True,
},
'remote... | 21.837209 | 55 | 0.592119 |
1ad81cedc9ccbac35d9eaa82fe820916f98367ac | 12,624 | py | Python | test/test_note.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 18 | 2018-04-19T08:30:48.000Z | 2022-02-14T11:00:27.000Z | test/test_note.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 15 | 2018-04-22T00:52:41.000Z | 2021-07-05T10:16:38.000Z | test/test_note.py | jdum/odfdo | 2494d0bed39f5a55974643206e9bafeed40f3a6b | [
"Apache-2.0"
] | 6 | 2018-04-22T00:14:12.000Z | 2021-12-06T01:42:07.000Z | #!/usr/bin/env python
# Copyright 2018 Jérôme Dumonteil
# Copyright (c) 2009-2010 Ars Aperta, Itaapy, Pierlis, Talend.
#
# 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.apach... | 37.238938 | 84 | 0.599493 |
1ad81fb367d2ae71db777d2cb2d8bce92d124ba3 | 438 | py | Python | python/q046/q046.py | MatthewTsan/Leetcode | b0705013eea8517ba7742730cd14ea8601b83c70 | [
"Apache-2.0"
] | null | null | null | python/q046/q046.py | MatthewTsan/Leetcode | b0705013eea8517ba7742730cd14ea8601b83c70 | [
"Apache-2.0"
] | null | null | null | python/q046/q046.py | MatthewTsan/Leetcode | b0705013eea8517ba7742730cd14ea8601b83c70 | [
"Apache-2.0"
] | null | null | null | from typing import List
class Solution:
def permute(self, nums: List[int]) -> List[List[int]]:
self.result = []
def DFS(tem_res):
if len(tem_res) == len(nums):
self.result.append(tem_res)
return
for item in nums:
if item in t... | 24.333333 | 58 | 0.477169 |
1ad823b05b0a6288f85998e83706e661594b5ae4 | 1,575 | py | Python | setup.py | tlatsas/sphinx-serve | f7659787f5375025e9bc0e72c4427f096ce6785d | [
"MIT"
] | 2 | 2015-12-24T05:38:18.000Z | 2021-06-29T09:16:06.000Z | setup.py | tlatsas/sphinx-serve | f7659787f5375025e9bc0e72c4427f096ce6785d | [
"MIT"
] | 1 | 2019-07-12T20:18:37.000Z | 2019-07-12T20:24:48.000Z | setup.py | tlatsas/sphinx-serve | f7659787f5375025e9bc0e72c4427f096ce6785d | [
"MIT"
] | 2 | 2019-07-12T20:21:00.000Z | 2021-06-29T09:14:20.000Z | # -*- coding: utf-8 -*-
"""
sphinx-serve
------------
Simple utility to easier preview your sphinx documentation.
After running the sphinx-serve command, it tries to detect the
sphinx build directory. It examines the current working directory
and if the build directory is not present, it tries to iterate
the parent p... | 24.609375 | 66 | 0.661587 |
1ad84d6af0a5efbafba3c1e3d88479e6ca215d29 | 79 | py | Python | python/note/setup/tool_test_yauno.py | YangXiaoo/NoteBook | 37056acad7a05b876832f72ac34d3d1a41e0dd22 | [
"CNRI-Python",
"RSA-MD",
"CECILL-B"
] | 58 | 2019-03-03T04:42:23.000Z | 2022-01-13T04:36:31.000Z | python/note/setup/tool_test_yauno.py | YangXiaoo/NoteBook | 37056acad7a05b876832f72ac34d3d1a41e0dd22 | [
"CNRI-Python",
"RSA-MD",
"CECILL-B"
] | null | null | null | python/note/setup/tool_test_yauno.py | YangXiaoo/NoteBook | 37056acad7a05b876832f72ac34d3d1a41e0dd22 | [
"CNRI-Python",
"RSA-MD",
"CECILL-B"
] | 28 | 2019-08-11T01:25:00.000Z | 2021-08-22T06:46:06.000Z | # coding:utf-8
def foo(arg=None):
print("successful install tool_test_yauno") | 19.75 | 44 | 0.759494 |
1ad872c8d3e8075d26d27b517cf3a8c7df3d5b14 | 980 | py | Python | test/unittests/test_SatStor.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | test/unittests/test_SatStor.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | test/unittests/test_SatStor.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | import numpy as np
from VariableUnittest import VariableUnitTest
from gwlfe.Input.WaterBudget import SatStor
class TestSatStor(VariableUnitTest):
def test_SatStor(self):
z = self.z
np.testing.assert_array_almost_equal(
SatStor.SatStor_f(z.NYrs, z.DaysMonth, z.Temp, z.InitSnow_0, z.Pr... | 49 | 120 | 0.583673 |
1ad8b7f9d8dfa7826d80eee8aeedbc6ca0240ee6 | 5,091 | py | Python | src/devel/___blocks/___block_base.py | jakub-vesely/hugo | 604e7824c39f6da43ede9064001292917c1ee4ae | [
"MIT"
] | null | null | null | src/devel/___blocks/___block_base.py | jakub-vesely/hugo | 604e7824c39f6da43ede9064001292917c1ee4ae | [
"MIT"
] | null | null | null | src/devel/___blocks/___block_base.py | jakub-vesely/hugo | 604e7824c39f6da43ede9064001292917c1ee4ae | [
"MIT"
] | null | null | null | # Copyright (c) 2022 Jakub Vesely
# This software is published under MIT license. Full text of the license is available at https://opensource.org/licenses/MIT
from ___basal.___logging import Logging
from ___blocks.___block_types import BlockTypes
import machine
import time
from micropython import const
_power_save_... | 40.086614 | 126 | 0.729916 |
1ad8c9598ee1252fb061798227e48a39ca0342fc | 3,232 | py | Python | scripts/tallies.py | pep8speaks/fhr-benchmark-1 | 531d518844de20ca70bd90522c573ead7aa459ce | [
"BSD-3-Clause"
] | 1 | 2020-11-24T09:56:12.000Z | 2020-11-24T09:56:12.000Z | scripts/tallies.py | pep8speaks/fhr-benchmark-1 | 531d518844de20ca70bd90522c573ead7aa459ce | [
"BSD-3-Clause"
] | null | null | null | scripts/tallies.py | pep8speaks/fhr-benchmark-1 | 531d518844de20ca70bd90522c573ead7aa459ce | [
"BSD-3-Clause"
] | null | null | null | import openmc
import openmc.mgxs as mgxs
from phase1a_constants import *
def tallies_generation(root):
""" Creates tallies.xml file
Parameters
----------
root: openmc.Universe with all the relevant cells for the geometry.
Returns
-------
This function generates the tallies.xml file.
... | 35.516484 | 71 | 0.592203 |
1ad8d736609380610907dbf8d0e0a271954ae71b | 414 | py | Python | CodeEval/Moderate/First Non-Repeated Character/character.py | Goyatuzo/HackerRank | ad836faa7e8ecfe751a72027e1312ae3ee19f4ca | [
"MIT"
] | null | null | null | CodeEval/Moderate/First Non-Repeated Character/character.py | Goyatuzo/HackerRank | ad836faa7e8ecfe751a72027e1312ae3ee19f4ca | [
"MIT"
] | 4 | 2016-03-19T05:13:29.000Z | 2021-05-10T16:42:42.000Z | CodeEval/Moderate/First Non-Repeated Character/character.py | Goyatuzo/Challenges | ad836faa7e8ecfe751a72027e1312ae3ee19f4ca | [
"MIT"
] | null | null | null | def first_non_repeating(input_string):
occured = {}
# First count the number of times char appears.
for char in input_string:
if char not in occured:
occured[char] = 1
else:
occured[char] += 1
# Then find the first letter that happens once in the string.
for... | 25.875 | 65 | 0.599034 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.