hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3ead84bd5d5e28185269b23e0aa67b71bef3ff | 7,632 | py | Python | ssd.py | kshramt/ssd.pytorch | 91214ba98c282663c117a4f3c691464460b8fa16 | [
"MIT"
] | null | null | null | ssd.py | kshramt/ssd.pytorch | 91214ba98c282663c117a4f3c691464460b8fa16 | [
"MIT"
] | null | null | null | ssd.py | kshramt/ssd.pytorch | 91214ba98c282663c117a4f3c691464460b8fa16 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import *
from data import voc, coco
import os
class SSD(nn.Module):
"""Single Shot Multibox Architecture
The network is composed of a base VGG network followed by the
added multibox conv laye... | 36.342857 | 79 | 0.550183 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import *
from data import voc, coco
import os
class SSD(nn.Module):
def __init__(self, phase, size, base, extras, head, num_classes):
super(SSD, self).__init__()
self.phase = phase
... | true | true |
1c3ead8902dc5079ac08b7790e806050bc90ad77 | 702 | py | Python | setup.py | thispl/hunter_douglas | 40ac85e9fba607ec8a9aa6a472b486f8b24f8600 | [
"MIT"
] | null | null | null | setup.py | thispl/hunter_douglas | 40ac85e9fba607ec8a9aa6a472b486f8b24f8600 | [
"MIT"
] | null | null | null | setup.py | thispl/hunter_douglas | 40ac85e9fba607ec8a9aa6a472b486f8b24f8600 | [
"MIT"
] | 1 | 2019-12-31T06:52:12.000Z | 2019-12-31T06:52:12.000Z | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import re, ast
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in hunter_douglas/__init__.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('hunter_douglas/_... | 27 | 69 | 0.739316 |
from setuptools import setup, find_packages
import re, ast
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('hunter_douglas/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().deco... | true | true |
1c3eae2cb9449c33d73e5d650ec292109dd9831e | 30,227 | py | Python | tensorflow/python/keras/optimizers.py | lambdabaa/tensorflow | b7e7addbd06c3ba414565f1cd50d734a45f6e12d | [
"Apache-2.0"
] | 26 | 2019-11-10T15:33:34.000Z | 2022-03-24T19:56:57.000Z | tensorflow/python/keras/optimizers.py | lambdabaa/tensorflow | b7e7addbd06c3ba414565f1cd50d734a45f6e12d | [
"Apache-2.0"
] | 1 | 2019-08-15T02:49:21.000Z | 2019-09-04T10:10:59.000Z | tensorflow/python/keras/optimizers.py | lambdabaa/tensorflow | b7e7addbd06c3ba414565f1cd50d734a45f6e12d | [
"Apache-2.0"
] | 6 | 2020-03-29T11:10:53.000Z | 2021-06-14T05:39:14.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.519389 | 126 | 0.656069 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from six.moves import zip
from tensorflow.python.distribute import distribution_strategy_context
from tensorflow.python.framework import ops
from tensorflow.python.keras import back... | true | true |
1c3eaf2c8d84487059c56d624eb2eba5474de60c | 26,113 | py | Python | source/tomopy/misc/corr.py | WilliamJudge94/tomopy | 301ee367d18ca6d18f2b9b18e2c531c33d4739e4 | [
"BSD-3-Clause"
] | null | null | null | source/tomopy/misc/corr.py | WilliamJudge94/tomopy | 301ee367d18ca6d18f2b9b18e2c531c33d4739e4 | [
"BSD-3-Clause"
] | null | null | null | source/tomopy/misc/corr.py | WilliamJudge94/tomopy | 301ee367d18ca6d18f2b9b18e2c531c33d4739e4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2015-2019, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2015-2019. UChicago Argonne, LLC.... | 30.649061 | 79 | 0.582354 |
s.sobel, arr[slc], output=out[slc])
return out
def remove_nan(arr, val=0., ncore=None):
arr = dtype.as_float32(arr)
val = np.float32(val)
with mproc.set_numexpr_threads(ncore):
ne.evaluate('where(arr!=arr, val, arr)', out=arr)
return arr
def remove_neg(arr, val=0., ncore=None):
... | true | true |
1c3eaf4d4b2cd9a62fb998a099bf380bf5054503 | 10,095 | py | Python | Packs/Phishing/Scripts/PhishingDedupPreprocessingRule/PhishingDedupPreprocessingRule_test.py | sandeepklog/content | 00e67220bf2842ff3931f8493b2b097f07aebcf4 | [
"MIT"
] | null | null | null | Packs/Phishing/Scripts/PhishingDedupPreprocessingRule/PhishingDedupPreprocessingRule_test.py | sandeepklog/content | 00e67220bf2842ff3931f8493b2b097f07aebcf4 | [
"MIT"
] | 2 | 2019-09-18T08:11:22.000Z | 2020-11-24T18:50:28.000Z | Packs/Phishing/Scripts/PhishingDedupPreprocessingRule/PhishingDedupPreprocessingRule_test.py | sandeepklog/content | 00e67220bf2842ff3931f8493b2b097f07aebcf4 | [
"MIT"
] | 2 | 2020-10-11T18:01:32.000Z | 2020-10-14T03:21:23.000Z | from CommonServerPython import *
from PhishingDedupPreprocessingRule import *
import json
ID_CONtER = 0
EXISTING_INCIDENTS = []
RESULTS = None
EXISTING_INCIDENT_ID = DUP_INCIDENT_ID = None
IDS_COUNTER = 0
text = "Imagine there's no countries It isn't hard to do Nothing to kill or die for And no religion too " \
... | 46.520737 | 117 | 0.750173 | from CommonServerPython import *
from PhishingDedupPreprocessingRule import *
import json
ID_CONtER = 0
EXISTING_INCIDENTS = []
RESULTS = None
EXISTING_INCIDENT_ID = DUP_INCIDENT_ID = None
IDS_COUNTER = 0
text = "Imagine there's no countries It isn't hard to do Nothing to kill or die for And no religion too " \
... | true | true |
1c3eafa1dc15b9815c461f8e4e81effe44ea1d93 | 582 | py | Python | tronapi/constants.py | oushu1zhangxiangxuan1/tron-api-python | d93959e758fb967584ad36372e29ab67eaa6dc79 | [
"MIT"
] | 111 | 2018-10-15T19:49:31.000Z | 2022-03-26T02:48:37.000Z | tronapi/constants.py | oushu1zhangxiangxuan1/tron-api-python | d93959e758fb967584ad36372e29ab67eaa6dc79 | [
"MIT"
] | 83 | 2018-10-24T18:49:56.000Z | 2022-03-02T21:36:21.000Z | tronapi/constants.py | oushu1zhangxiangxuan1/tron-api-python | d93959e758fb967584ad36372e29ab67eaa6dc79 | [
"MIT"
] | 78 | 2018-10-16T06:29:10.000Z | 2022-03-18T04:39:53.000Z | # --------------------------------------------------------------------
# Copyright (c) iEXBase. All rights reserved.
# Licensed under the MIT License.
# See License.txt in the project root for license information.
# --------------------------------------------------------------------
# Here we specify default values f... | 41.571429 | 73 | 0.546392 |
DEFAULT_NODES = {
'full_node': 'https://api.trongrid.io',
'solidity_node': 'https://api.trongrid.io',
'event_server': 'https://api.trongrid.io'
}
| true | true |
1c3eb035ee715827be07854c75e698fafd898d35 | 3,278 | py | Python | model/model_api.py | thukg/KG-concept-game | daedea0f9109012a079833de034766ad23c731b6 | [
"MIT"
] | 1 | 2019-09-27T11:05:17.000Z | 2019-09-27T11:05:17.000Z | model/model_api.py | thukg/KG-concept-game | daedea0f9109012a079833de034766ad23c731b6 | [
"MIT"
] | null | null | null | model/model_api.py | thukg/KG-concept-game | daedea0f9109012a079833de034766ad23c731b6 | [
"MIT"
] | null | null | null | from model.random_model import RandomModel
from model.greedy_model import GreedyModel
from model.min_max_model import MinMaxModel
from model.alpha_beta_model import AlphaBetaModel
from model.sprague_grundy_model import SpragueGrundyModel
from model.fully_connected_network_model import FCNModel
import config
def name_t... | 29.00885 | 110 | 0.527761 | from model.random_model import RandomModel
from model.greedy_model import GreedyModel
from model.min_max_model import MinMaxModel
from model.alpha_beta_model import AlphaBetaModel
from model.sprague_grundy_model import SpragueGrundyModel
from model.fully_connected_network_model import FCNModel
import config
def name_t... | true | true |
1c3eb0bec389a633714fba8a9b6f018621b05d62 | 3,789 | py | Python | tools/bin/convertAllTas.py | cpausmit/Tapas | 283016cebc036a703609317aafc28675b1c1ea17 | [
"MIT"
] | null | null | null | tools/bin/convertAllTas.py | cpausmit/Tapas | 283016cebc036a703609317aafc28675b1c1ea17 | [
"MIT"
] | null | null | null | tools/bin/convertAllTas.py | cpausmit/Tapas | 283016cebc036a703609317aafc28675b1c1ea17 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# --------------------------------------------------------------------------------------------------
# Convert all tas from many separate tables per semester to a single table with additional
# semester Id.
#
#--------------------------------------------------------------------------------------------... | 30.804878 | 100 | 0.495909 |
import sys,os,re
import MySQLdb
import Database
def makeTasTable(cursor,execute):
sql = "describe Tas;"
try:
print " MYSQL> " + sql
if execute == "exec":
cursor.execute(sql)
print ' INFO -- table (Tas) exists already.\n'
except:
p... | false | true |
1c3eb15d7da6787510d8cb568e87d91b919b684c | 2,109 | py | Python | python_bindings/tutorial/lesson_10_aot_compilation_run.py | OAID/Halide | 769b8554ec36b70ea53c73605ad021cf431476fc | [
"Apache-2.0"
] | 4,303 | 2015-01-02T12:04:37.000Z | 2022-03-31T11:35:06.000Z | python_bindings/tutorial/lesson_10_aot_compilation_run.py | OAID/Halide | 769b8554ec36b70ea53c73605ad021cf431476fc | [
"Apache-2.0"
] | 4,323 | 2015-01-01T13:31:25.000Z | 2022-03-31T22:43:57.000Z | python_bindings/tutorial/lesson_10_aot_compilation_run.py | OAID/Halide | 769b8554ec36b70ea53c73605ad021cf431476fc | [
"Apache-2.0"
] | 1,032 | 2015-01-12T12:50:16.000Z | 2022-03-28T01:55:11.000Z | # Before reading this file, see lesson_10_aot_compilation_generate.py
# This is the code that actually uses the Halide pipeline we've
# compiled. It does not depend on libHalide, so we won't do
# "import halide".
#
# Instead, it depends on the header file that lesson_10_generate
# produced when we ran it:
import lesso... | 33.47619 | 87 | 0.656235 |
# compiled. It does not depend on libHalide, so we won't do
import lesson_10_halide
import numpy as np
def main():
input = np.empty((640, 480), dtype=np.uint8, order='F')
for y in range(480):
for x in range(640):
... | true | true |
1c3eb1e919896db847c780c05402b1f04e03739c | 4,242 | py | Python | workspace_tools/export/__init__.py | bygreencn/mbed | 9196548e9a7230011d499556e9d162718febb7eb | [
"Apache-2.0"
] | 1 | 2019-05-07T15:01:19.000Z | 2019-05-07T15:01:19.000Z | workspace_tools/export/__init__.py | bygreencn/mbed | 9196548e9a7230011d499556e9d162718febb7eb | [
"Apache-2.0"
] | null | null | null | workspace_tools/export/__init__.py | bygreencn/mbed | 9196548e9a7230011d499556e9d162718febb7eb | [
"Apache-2.0"
] | null | null | null | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | 35.647059 | 203 | 0.661245 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | false | true |
1c3eb3b6d07c2dc5556bce9a07ea0abe005bbfa9 | 52,497 | py | Python | espnet/asr/pytorch_backend/asr_rnn_t.py | Baileyswu/espnet | 7ce470058f8fdb28db00ec2d0bd51d290b109d3b | [
"Apache-2.0"
] | null | null | null | espnet/asr/pytorch_backend/asr_rnn_t.py | Baileyswu/espnet | 7ce470058f8fdb28db00ec2d0bd51d290b109d3b | [
"Apache-2.0"
] | null | null | null | espnet/asr/pytorch_backend/asr_rnn_t.py | Baileyswu/espnet | 7ce470058f8fdb28db00ec2d0bd51d290b109d3b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
# Copyright 2017 Johns Hopkins University (Shinji Watanabe)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Training/decoding definition for the speech recognition task."""
import copy
import json
import logging
import math
import os
import sys
from chainer im... | 35.785276 | 88 | 0.561232 |
import copy
import json
import logging
import math
import os
import sys
from chainer import reporter as reporter_module
from chainer import training
from chainer.training import extensions
from chainer.training.updater import StandardUpdater
import numpy as np
from tensorboardX import SummaryWriter
import torch... | true | true |
1c3eb4f292655133a8344fddffc7c4dc2b1eda07 | 1,773 | py | Python | gencode/python/udmi/schema/model_pointset_point.py | johnrandolph/udmi | 5e9de32fc71de8d006cda2eba4d3372eaf24c7c0 | [
"Apache-2.0"
] | 1 | 2022-02-24T22:57:37.000Z | 2022-02-24T22:57:37.000Z | gencode/python/udmi/schema/model_pointset_point.py | johnrandolph/udmi | 5e9de32fc71de8d006cda2eba4d3372eaf24c7c0 | [
"Apache-2.0"
] | 5 | 2022-02-24T21:32:24.000Z | 2022-03-23T15:52:25.000Z | gencode/python/udmi/schema/model_pointset_point.py | johnrandolph/udmi | 5e9de32fc71de8d006cda2eba4d3372eaf24c7c0 | [
"Apache-2.0"
] | null | null | null | """Generated class for model_pointset_point.json"""
class PointPointsetModel:
"""Generated schema class"""
def __init__(self):
self.units = None
self.writable = None
self.baseline_value = None
self.baseline_tolerance = None
self.baseline_state = None
self.cov_increment = None
self.ref... | 28.142857 | 77 | 0.673999 |
class PointPointsetModel:
def __init__(self):
self.units = None
self.writable = None
self.baseline_value = None
self.baseline_tolerance = None
self.baseline_state = None
self.cov_increment = None
self.ref = None
@staticmethod
def from_dict(source):
if not source:
return N... | true | true |
1c3eb6073760458c9c196286f9f2a366494125d3 | 3,700 | py | Python | test.py | chris0711/curl_rainbow | 2badc1302ef55b8512e6c5a0616045a1a0fd4273 | [
"MIT"
] | 38 | 2020-07-07T11:29:18.000Z | 2022-03-28T13:38:04.000Z | test.py | chris0711/curl_rainbow | 2badc1302ef55b8512e6c5a0616045a1a0fd4273 | [
"MIT"
] | 6 | 2020-08-01T11:44:39.000Z | 2021-06-24T00:15:23.000Z | test.py | chris0711/curl_rainbow | 2badc1302ef55b8512e6c5a0616045a1a0fd4273 | [
"MIT"
] | 18 | 2020-08-07T04:42:37.000Z | 2021-12-08T22:42:14.000Z | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017 Kai Arulkumaran
#
# 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,... | 42.528736 | 434 | 0.687568 |
from __future__ import division
import os
import plotly
from plotly.graph_objs import Scatter
from plotly.graph_objs.scatter import Line
import torch
from env import Env
def test(args, T, dqn, val_mem, metrics, results_dir, evaluate=False):
env = Env(args)
env.eval()
metrics['steps'].append(T)
T_re... | true | true |
1c3eb626753b3d4b15e3faae5bef575eb9c8fca1 | 1,352 | py | Python | veles/paths.py | AkshayJainG/veles | 21106f41a8e7e7e74453cd16a5059a0e6b1c315e | [
"Apache-2.0"
] | 1,007 | 2015-07-20T12:01:41.000Z | 2022-03-30T23:08:35.000Z | veles/paths.py | AkshayJainG/veles | 21106f41a8e7e7e74453cd16a5059a0e6b1c315e | [
"Apache-2.0"
] | 52 | 2015-07-21T10:26:24.000Z | 2019-01-24T05:46:43.000Z | veles/paths.py | AkshayJainG/veles | 21106f41a8e7e7e74453cd16a5059a0e6b1c315e | [
"Apache-2.0"
] | 235 | 2015-07-20T09:42:42.000Z | 2021-12-06T18:12:26.000Z | # -*- coding: utf-8 -*-
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| `--. \
\ \_/ / |___| |___| |___/\__/ /
\___/\____/\_____|____/\____/
Created on Nov 5, 2014
████████████████████████████████████████... | 33.8 | 79 | 0.598373 |
import os
__root__ = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
__home__ = os.path.join(os.environ.get("HOME", "./"), ".veles")
| true | true |
1c3eb762b26ba98f8d24bccb5374ee0b4f2d6251 | 2,755 | py | Python | src/oci/secrets/models/base64_secret_bundle_content_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/secrets/models/base64_secret_bundle_content_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/secrets/models/base64_secret_bundle_content_details.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... | 34.012346 | 245 | 0.675136 |
from .secret_bundle_content_details import SecretBundleContentDetails
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel
from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class Base64SecretBundleContentDetails(SecretBundleContentDetai... | true | true |
1c3eb839a1a83e35d187d725833190d3a81fc9c5 | 1,049 | py | Python | PR_BCI_team/Team_StarLab/YJKim/shallow_cnn_with_mne/gigadata2.py | PatternRecognition/OpenBMI | d9291ddb81f4319fb3764d7192e0363939a62ee9 | [
"MIT"
] | 217 | 2015-11-02T11:10:29.000Z | 2022-03-22T07:01:12.000Z | PR_BCI_team/Team_StarLab/YJKim/shallow_cnn_with_mne/gigadata2.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 24 | 2015-11-02T11:10:45.000Z | 2021-09-08T11:10:33.000Z | PR_BCI_team/Team_StarLab/YJKim/shallow_cnn_with_mne/gigadata2.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 112 | 2016-01-22T01:45:44.000Z | 2022-03-22T07:08:19.000Z | import scipy.io as sio
import numpy as np
import mne
def load_gigadata(MI, variable_names, plot=False):
temp = MI[variable_names]
sfreq = 1000 # Sampling frequency
chan = temp.chan.tolist()
# 채널정보 추가해야함
info = mne.create_info(ch_names=chan, sfreq=sfreq, ch_types='eeg')
t = np.hstack((temp.t.... | 33.83871 | 88 | 0.64347 | import scipy.io as sio
import numpy as np
import mne
def load_gigadata(MI, variable_names, plot=False):
temp = MI[variable_names]
sfreq = 1000
chan = temp.chan.tolist()
info = mne.create_info(ch_names=chan, sfreq=sfreq, ch_types='eeg')
t = np.hstack((temp.t.reshape(100, 1), np.zeros((100, ... | true | true |
1c3eb889ab3a9e447cb4b4e471bb818daaf9273e | 1,510 | py | Python | chatbot_tutorial/models.py | Jishin4477/Djangobot | 41eda19b683224dcf2efdb80dd178aa03e7bad82 | [
"MIT"
] | null | null | null | chatbot_tutorial/models.py | Jishin4477/Djangobot | 41eda19b683224dcf2efdb80dd178aa03e7bad82 | [
"MIT"
] | null | null | null | chatbot_tutorial/models.py | Jishin4477/Djangobot | 41eda19b683224dcf2efdb80dd178aa03e7bad82 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from chatbot_tutorial._threading_local import local
def set_current_user(user):
_thread_locals.user = user
def get_current_user():
return getattr(_thread_locals, 'user', None)
class DateTimeBase(models.Model):
created_at = models.... | 29.607843 | 77 | 0.676821 | from django.db import models
from django.contrib.auth.models import User
from chatbot_tutorial._threading_local import local
def set_current_user(user):
_thread_locals.user = user
def get_current_user():
return getattr(_thread_locals, 'user', None)
class DateTimeBase(models.Model):
created_at = models.... | true | true |
1c3eb8a0eae5f3799e563e32e38c6313e70f3209 | 8,763 | py | Python | futu/common/pb/Qot_GetRehab_pb2.py | liteself/py-futu-api | a78f5b46f56d30fb82a42951823afea4b5ed1307 | [
"Apache-2.0"
] | 2 | 2020-03-18T09:54:03.000Z | 2020-05-15T08:13:33.000Z | futu/common/pb/Qot_GetRehab_pb2.py | liteself/py-futu-api | a78f5b46f56d30fb82a42951823afea4b5ed1307 | [
"Apache-2.0"
] | 1 | 2020-04-21T02:42:32.000Z | 2020-04-21T02:42:32.000Z | futu/common/pb/Qot_GetRehab_pb2.py | liteself/py-futu-api | a78f5b46f56d30fb82a42951823afea4b5ed1307 | [
"Apache-2.0"
] | 1 | 2021-02-17T17:46:36.000Z | 2021-02-17T17:46:36.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Qot_GetRehab.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _... | 33.067925 | 760 | 0.744266 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google... | true | true |
1c3eb8ac4bfe8c177995657ed6dd4e2736b430c7 | 1,896 | py | Python | data/image_folder.py | matsumototo180/pytorch-CycleGAN-and-pix2pix-music | e9b39a51226c3ea67e3463df5218ff4beca8c7f7 | [
"BSD-3-Clause"
] | null | null | null | data/image_folder.py | matsumototo180/pytorch-CycleGAN-and-pix2pix-music | e9b39a51226c3ea67e3463df5218ff4beca8c7f7 | [
"BSD-3-Clause"
] | null | null | null | data/image_folder.py | matsumototo180/pytorch-CycleGAN-and-pix2pix-music | e9b39a51226c3ea67e3463df5218ff4beca8c7f7 | [
"BSD-3-Clause"
] | null | null | null | """A modified image folder class
We modify the official PyTorch image folder (https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py)
so that this class can load images from both current directory and its subdirectories.
"""
import torch.utils.data as data
from PIL import Image
import os
IMG_E... | 28.298507 | 122 | 0.611287 |
import torch.utils.data as data
from PIL import Image
import os
IMG_EXTENSIONS = [
'.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP',
'.tif', '.TIF', '.tiff', '.TIFF',
'.npy'
]
def is_image_file(filename):
return any(filename.endswith(extension) for extension in I... | true | true |
1c3eba13da06e644c32c86598cdc0ded3557d779 | 6,680 | py | Python | Lib/idlelib/aboutDialog.py | rbuzatu90/hyperv-python | 82bf5a72b4d956ea05affe1644b47e378dec0f4e | [
"bzip2-1.0.6"
] | 69 | 2015-12-28T07:02:51.000Z | 2022-03-31T13:36:42.000Z | Lib/idlelib/aboutDialog.py | rbuzatu90/hyperv-python | 82bf5a72b4d956ea05affe1644b47e378dec0f4e | [
"bzip2-1.0.6"
] | 23 | 2016-03-04T10:43:24.000Z | 2021-03-17T09:58:19.000Z | Lib/idlelib/aboutDialog.py | rbuzatu90/hyperv-python | 82bf5a72b4d956ea05affe1644b47e378dec0f4e | [
"bzip2-1.0.6"
] | 24 | 2016-02-29T11:45:47.000Z | 2021-12-24T08:41:37.000Z | """About Dialog for IDLE
"""
from Tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self, parent, title, _htest=False):
"""
_htest - bool, change box location when running htes... | 45.442177 | 80 | 0.582186 |
from Tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
def __init__(self, parent, title, _htest=False):
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
self.geometry("+%d+%d" % (
... | true | true |
1c3eba29dfde112cc3cbe366acda5cf030a01733 | 5,117 | py | Python | memsource_cli/models/lqa_settings_dto.py | unofficial-memsource/memsource-cli-client | a6639506b74e95476da87f4375953448b76ea90c | [
"Apache-2.0"
] | 16 | 2019-09-25T00:20:38.000Z | 2021-05-04T05:56:10.000Z | memsource_cli/models/lqa_settings_dto.py | zerodayz/memsource-cli-client | c2574f1467539a49e6637c874e88d75c7ef789b3 | [
"Apache-2.0"
] | 26 | 2019-09-30T14:00:03.000Z | 2021-05-12T11:15:18.000Z | memsource_cli/models/lqa_settings_dto.py | zerodayz/memsource-cli-client | c2574f1467539a49e6637c874e88d75c7ef789b3 | [
"Apache-2.0"
] | 1 | 2021-05-24T16:19:14.000Z | 2021-05-24T16:19:14.000Z | # coding: utf-8
"""
Memsource REST API
Welcome to Memsource's API documentation. To view our legacy APIs please [visit our documentation](https://wiki.memsource.com/wiki/Memsource_API) and for more information about our new APIs, [visit our blog](https://www.memsource.com/blog/2017/10/24/introducing-rest-apis... | 29.923977 | 421 | 0.601133 |
import pprint
import re
import six
from memsource_cli.models.lqa_error_category_dto import LqaErrorCategoryDto
from memsource_cli.models.lqa_severity_dto import LqaSeverityDto
class LqaSettingsDto(object):
swagger_types = {
'enabled': 'bool',
'severities': 'list[LqaSeverityDto]',
... | true | true |
1c3eba7512c64be760bcd42530a076ee253a07df | 827 | py | Python | setup.py | keshavdv/hikvision-client | dbebe399ea5ecbbd236488cda28242d134a9f72f | [
"MIT"
] | null | null | null | setup.py | keshavdv/hikvision-client | dbebe399ea5ecbbd236488cda28242d134a9f72f | [
"MIT"
] | null | null | null | setup.py | keshavdv/hikvision-client | dbebe399ea5ecbbd236488cda28242d134a9f72f | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from os.path import join, dirname
import re
with open('hikvisionapi/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
setup(name='hikvisionapi',
version=version,
... | 39.380952 | 92 | 0.650544 | from setuptools import setup, find_packages
from os.path import join, dirname
import re
with open('hikvisionapi/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
setup(name='hikvisionapi',
version=version,
... | true | true |
1c3eba76465db2b8dee9184bb19fce222cfaebed | 21,677 | py | Python | keras/layers/convolutional_recurrent.py | ypxie/keras-1 | f1ed8d63faa26ce6180faa685839aa32217211c6 | [
"MIT"
] | 1 | 2017-11-15T14:52:07.000Z | 2017-11-15T14:52:07.000Z | keras/layers/convolutional_recurrent.py | ypxie/keras-1 | f1ed8d63faa26ce6180faa685839aa32217211c6 | [
"MIT"
] | null | null | null | keras/layers/convolutional_recurrent.py | ypxie/keras-1 | f1ed8d63faa26ce6180faa685839aa32217211c6 | [
"MIT"
] | 1 | 2021-05-01T09:39:57.000Z | 2021-05-01T09:39:57.000Z | from .. import backend as K
from .. import activations, initializations, regularizers
import numpy as np
from ..engine import Layer, InputSpec
from ..utils.np_utils import conv_output_length
import warnings
class ConvRecurrent2D(Layer):
'''Abstract base class for convolutional recurrent layers.
Do not use in... | 42.420744 | 96 | 0.564562 | from .. import backend as K
from .. import activations, initializations, regularizers
import numpy as np
from ..engine import Layer, InputSpec
from ..utils.np_utils import conv_output_length
import warnings
class ConvRecurrent2D(Layer):
def __init__(self, weights=None, nb_row=None, nb_col=None, nb_filter=None,
... | true | true |
1c3ebae06ecaeff2cc3672f54ae2f7f6aacdadc3 | 1,642 | py | Python | tests/test_fastapi_utils/test_features/test_inferring_router.py | dmontagu/fastapi-auth | d0e86774f66bd43e80376de19bdf034eb228dc07 | [
"MIT"
] | 87 | 2019-12-18T05:43:25.000Z | 2022-03-30T20:04:11.000Z | tests/test_fastapi_utils/test_features/test_inferring_router.py | dmontagu/fastapi-auth | d0e86774f66bd43e80376de19bdf034eb228dc07 | [
"MIT"
] | 2 | 2020-08-07T05:17:18.000Z | 2021-09-14T03:20:04.000Z | tests/test_fastapi_utils/test_features/test_inferring_router.py | dmontagu/fastapi-auth | d0e86774f66bd43e80376de19bdf034eb228dc07 | [
"MIT"
] | 7 | 2020-03-08T17:14:33.000Z | 2022-01-01T21:38:47.000Z | from fastapi import FastAPI
from fastapi_auth.fastapi_util.features.inferring_router import InferringRouter
openapi_spec = {
"info": {"title": "Fast API", "version": "0.1.0"},
"openapi": "3.0.2",
"paths": {
"/1": {
"get": {
"operationId": "endpoint_1_1_get",
... | 29.854545 | 120 | 0.433618 | from fastapi import FastAPI
from fastapi_auth.fastapi_util.features.inferring_router import InferringRouter
openapi_spec = {
"info": {"title": "Fast API", "version": "0.1.0"},
"openapi": "3.0.2",
"paths": {
"/1": {
"get": {
"operationId": "endpoint_1_1_get",
... | true | true |
1c3ebb2ffa9845ad6f59777ce682acd6917daa3e | 808 | py | Python | wazimap_ng/points/services/locations.py | Faysalali534/wazimap-ng | 64cff12c042167ce633658a3c45f7c142f3fd5ce | [
"Apache-2.0"
] | null | null | null | wazimap_ng/points/services/locations.py | Faysalali534/wazimap-ng | 64cff12c042167ce633658a3c45f7c142f3fd5ce | [
"Apache-2.0"
] | null | null | null | wazimap_ng/points/services/locations.py | Faysalali534/wazimap-ng | 64cff12c042167ce633658a3c45f7c142f3fd5ce | [
"Apache-2.0"
] | null | null | null | import logging
from wazimap_ng.points.models import Location, Category, ProfileCategory
from wazimap_ng.profile.models import Profile
from wazimap_ng.datasets.models import Geography
from wazimap_ng.boundaries.models import GeographyBoundary
logger = logging.getLogger(__name__)
def get_locations(queryset, profile, c... | 35.130435 | 80 | 0.782178 | import logging
from wazimap_ng.points.models import Location, Category, ProfileCategory
from wazimap_ng.profile.models import Profile
from wazimap_ng.datasets.models import Geography
from wazimap_ng.boundaries.models import GeographyBoundary
logger = logging.getLogger(__name__)
def get_locations(queryset, profile, c... | true | true |
1c3ebb6f9ba90fb1b3461a4f89c26e5e1da1a7b6 | 19,196 | py | Python | conda/activate.py | richmoore1962/conda | ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306 | [
"BSD-3-Clause"
] | null | null | null | conda/activate.py | richmoore1962/conda | ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306 | [
"BSD-3-Clause"
] | null | null | null | conda/activate.py | richmoore1962/conda | ef36713bfeca5b9a8505ff8ae6d7899c2d7c6306 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from glob import glob
import os
from os.path import abspath, basename, dirname, expanduser, expandvars, isdir, join, normpath
import re
import sys
from tempfile import NamedTemporaryFile
from .base.context impor... | 38.163022 | 98 | 0.603824 |
from __future__ import absolute_import, division, print_function, unicode_literals
from glob import glob
import os
from os.path import abspath, basename, dirname, expanduser, expandvars, isdir, join, normpath
import re
import sys
from tempfile import NamedTemporaryFile
from .base.context import ROOT_ENV_NAME, contex... | true | true |
1c3ebd21eb0eee42e9366167ff296002780b5492 | 4,688 | py | Python | python/galB_models.py | bsafdi/galacticB | cf90459799b0917340f7b6faceab6134dc3c35b0 | [
"MIT"
] | null | null | null | python/galB_models.py | bsafdi/galacticB | cf90459799b0917340f7b6faceab6134dc3c35b0 | [
"MIT"
] | null | null | null | python/galB_models.py | bsafdi/galacticB | cf90459799b0917340f7b6faceab6134dc3c35b0 | [
"MIT"
] | null | null | null | import numpy as np
import numpy.linalg as LA
#B-field model from https://arxiv.org/pdf/1204.3662.pdf
iopen=11.5 #degrees
rmx_array = np.array([5.1,6.3,7.1,8.3,9.8,11.4,12.7,15.5]) #kpc
def return_B(x,y):
'''
x,y in Galactic coords in kpc
Earth at (x,y) = (-8.5,0)
'''
r = np.sqrt(x,y)
phi = ... | 23.323383 | 96 | 0.53221 | import numpy as np
import numpy.linalg as LA
iopen=11.5
rmx_array = np.array([5.1,6.3,7.1,8.3,9.8,11.4,12.7,15.5])
def return_B(x,y):
r = np.sqrt(x,y)
phi = np.arctanM(y,x)
r_hat = np.array([np.cos(phi),np.sin(phi)])
phi_hat = np.array([-np.sin(phi),np.cos(phi)])
if r<5.0:
... | true | true |
1c3ebe5799f9f096dadc724348ff63069ef11359 | 1,884 | py | Python | alipay/aop/api/response/AlipayFundTransPayResponse.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/response/AlipayFundTransPayResponse.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/response/AlipayFundTransPayResponse.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.response.AlipayResponse import AlipayResponse
class AlipayFundTransPayResponse(AlipayResponse):
def __init__(self):
super(AlipayFundTransPayResponse, self).__init__()
self._order_id = None
self._out_biz_no = No... | 28.545455 | 99 | 0.664544 |
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayFundTransPayResponse(AlipayResponse):
def __init__(self):
super(AlipayFundTransPayResponse, self).__init__()
self._order_id = None
self._out_biz_no = None
self._pay_fund_order_id = None
... | true | true |
1c3ebf1f7628958d5b11ec3a7ac39fd0b4c0e80d | 13,347 | py | Python | pytorch_lightning/accelerators/tpu_accelerator.py | aribornstein/pytorch-lightning | ca68cac57ad8eefc9b477ee126eb42a483f27a39 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/tpu_accelerator.py | aribornstein/pytorch-lightning | ca68cac57ad8eefc9b477ee126eb42a483f27a39 | [
"Apache-2.0"
] | null | null | null | pytorch_lightning/accelerators/tpu_accelerator.py | aribornstein/pytorch-lightning | ca68cac57ad8eefc9b477ee126eb42a483f27a39 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 36.467213 | 110 | 0.66352 |
import io
import logging
import os
import re
from typing import Any, Callable, Optional, Union
import torch
import torch.multiprocessing as mp
from torch.optim import Optimizer
from pytorch_lightning.accelerators.accelerator import Accelerator, ReduceOp
from pytorch_lightning.cluster_environments import ... | true | true |
1c3ebf5598e69feb2c336c6da8f14570efb46fc9 | 2,548 | py | Python | open_spiel/python/bots/is_mcts_test.py | texasmichelle/open_spiel | d9a9b8f9f1f44143867217fc3f6ff2db71b174b0 | [
"Apache-2.0"
] | 3,167 | 2019-08-27T06:50:30.000Z | 2022-03-31T22:33:48.000Z | open_spiel/python/bots/is_mcts_test.py | texasmichelle/open_spiel | d9a9b8f9f1f44143867217fc3f6ff2db71b174b0 | [
"Apache-2.0"
] | 650 | 2019-08-27T16:24:09.000Z | 2022-03-30T19:41:09.000Z | open_spiel/python/bots/is_mcts_test.py | texasmichelle/open_spiel | d9a9b8f9f1f44143867217fc3f6ff2db71b174b0 | [
"Apache-2.0"
] | 774 | 2019-08-27T10:36:04.000Z | 2022-03-29T15:44:42.000Z | # Copyright 2019 DeepMind Technologies Ltd. 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 appl... | 35.887324 | 80 | 0.720173 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import absltest
import numpy as np
from open_spiel.python.algorithms import evaluate_bots
import pyspiel
SEED = 12983641
class ISMCTSBotTest(absltest.TestCase):
def ismct... | true | true |
1c3ebf8534de15eccfa8e05d6772024a0cb19ba3 | 1,621 | py | Python | src/izi/apps/catalogue/reviews/forms.py | izi-core/izi-core | 21176be2d41f0cf54ca954f294209c585f643dba | [
"BSD-3-Clause"
] | null | null | null | src/izi/apps/catalogue/reviews/forms.py | izi-core/izi-core | 21176be2d41f0cf54ca954f294209c585f643dba | [
"BSD-3-Clause"
] | null | null | null | src/izi/apps/catalogue/reviews/forms.py | izi-core/izi-core | 21176be2d41f0cf54ca954f294209c585f643dba | [
"BSD-3-Clause"
] | null | null | null | from django import forms
from django.utils.translation import gettext_lazy as _
from izi.core.loading import get_model
Vote = get_model('reviews', 'vote')
ProductReview = get_model('reviews', 'productreview')
class ProductReviewForm(forms.ModelForm):
name = forms.CharField(label=_('Name'), required=True)
em... | 26.57377 | 61 | 0.632326 | from django import forms
from django.utils.translation import gettext_lazy as _
from izi.core.loading import get_model
Vote = get_model('reviews', 'vote')
ProductReview = get_model('reviews', 'productreview')
class ProductReviewForm(forms.ModelForm):
name = forms.CharField(label=_('Name'), required=True)
em... | true | true |
1c3ec00dd8b2fd9f7864c69b14adc250d65def9a | 1,730 | py | Python | setup.py | chiangtw/CircMiMi | f9700ab3afb79e5b730b95666482ba64f3e6ef75 | [
"MIT"
] | 2 | 2021-09-13T13:12:46.000Z | 2022-01-03T05:04:32.000Z | setup.py | chiangtw/CircMiMi | f9700ab3afb79e5b730b95666482ba64f3e6ef75 | [
"MIT"
] | null | null | null | setup.py | chiangtw/CircMiMi | f9700ab3afb79e5b730b95666482ba64f3e6ef75 | [
"MIT"
] | 1 | 2020-05-16T13:24:13.000Z | 2020-05-16T13:24:13.000Z | import codecs
import os
import re
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
with codecs.open(os.path.join(here, *parts), 'r') as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
version_ma... | 30.350877 | 82 | 0.625434 | import codecs
import os
import re
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
with codecs.open(os.path.join(here, *parts), 'r') as fp:
return fp.read()
def find_version(*file_paths):
version_file = read(*file_paths)
version_ma... | true | true |
1c3ec0239a3b51d83462da9640c1889bef35013b | 3,540 | py | Python | decloud/models/monthly_synthesis_6_s2s1_images_david.py | CNES/decloud | 6b06ae98bfe68821b4ebd0e7ba06723809cb9b42 | [
"Apache-2.0"
] | 8 | 2022-02-25T13:15:07.000Z | 2022-03-20T18:29:49.000Z | decloud/models/monthly_synthesis_6_s2s1_images_david.py | CNES/decloud | 6b06ae98bfe68821b4ebd0e7ba06723809cb9b42 | [
"Apache-2.0"
] | 1 | 2022-02-25T13:21:33.000Z | 2022-02-25T13:21:33.000Z | decloud/models/monthly_synthesis_6_s2s1_images_david.py | CNES/decloud | 6b06ae98bfe68821b4ebd0e7ba06723809cb9b42 | [
"Apache-2.0"
] | 1 | 2022-03-31T23:43:12.000Z | 2022-03-31T23:43:12.000Z | # -*- coding: utf-8 -*-
"""
Copyright (c) 2020-2022 INRAE
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, ... | 51.304348 | 110 | 0.666384 |
from tensorflow.keras import layers
from decloud.models.model import Model
from decloud.preprocessing import constants
class monthly_synthesis_6_s2s1_images_david(Model):
def __init__(self, dataset_shapes,
dataset_input_keys=["s2_t0", "s2_t1", "s2_t2", "s2_t3", "s2_t4", "s2_t5",
... | true | true |
1c3ec0608c6faed4e34cec115e9524d65fc136d9 | 667 | py | Python | utils/batch_helper.py | liushengzhong1023/multihead-siamese-nets | ccb544d5a8adefa41743ef7948aeb5f20a74507e | [
"MIT"
] | 175 | 2018-01-26T19:22:05.000Z | 2022-02-24T01:20:21.000Z | utils/batch_helper.py | liushengzhong1023/multihead-siamese-nets | ccb544d5a8adefa41743ef7948aeb5f20a74507e | [
"MIT"
] | 19 | 2018-02-26T09:45:59.000Z | 2022-02-09T23:57:22.000Z | utils/batch_helper.py | warisqr007/ConvSANN | 0cede14601ce1a62bd58abf92a04ad3d7cc3be99 | [
"MIT"
] | 41 | 2018-02-27T11:20:28.000Z | 2021-04-13T04:57:57.000Z |
class BatchHelper:
def __init__(self, x1, x2, labels, batch_size):
self.x1 = x1
# self.x1 = self.x1.reshape(-1, 1)
self.x2 = x2
# self.x2 = self.x2.reshape(-1, 1)
self.labels = labels
self.labels = self.labels.reshape(-1, 1)
self.batch_size = batch_size
... | 39.235294 | 95 | 0.623688 |
class BatchHelper:
def __init__(self, x1, x2, labels, batch_size):
self.x1 = x1
self.x2 = x2
self.labels = labels
self.labels = self.labels.reshape(-1, 1)
self.batch_size = batch_size
def next(self, batch_id):
x1_batch = self.x1[batch_id * se... | true | true |
1c3ec089f6634e8a94af71b4270bf1a322b29773 | 76,413 | py | Python | openpype/tools/project_manager/project_manager/model.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | openpype/tools/project_manager/project_manager/model.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | openpype/tools/project_manager/project_manager/model.py | jonclothcat/OpenPype | d1208cbebc0a7f378de0062ccd653295c6399195 | [
"MIT"
] | null | null | null | import collections
import copy
import json
from uuid import uuid4
from pymongo import UpdateOne, DeleteOne
from Qt import QtCore, QtGui
from .constants import (
IDENTIFIER_ROLE,
ITEM_TYPE_ROLE,
DUPLICATED_ROLE,
HIERARCHY_CHANGE_ABLE_ROLE,
REMOVED_ROLE,
EDITOR_OPENED_ROLE,
PROJECT_NAME_ROL... | 31.497527 | 79 | 0.561776 | import collections
import copy
import json
from uuid import uuid4
from pymongo import UpdateOne, DeleteOne
from Qt import QtCore, QtGui
from .constants import (
IDENTIFIER_ROLE,
ITEM_TYPE_ROLE,
DUPLICATED_ROLE,
HIERARCHY_CHANGE_ABLE_ROLE,
REMOVED_ROLE,
EDITOR_OPENED_ROLE,
PROJECT_NAME_ROL... | true | true |
1c3ec10c0be0c50347ae5364aa263e5e25c717b6 | 4,954 | py | Python | pdbtools/pdb_chain.py | andrewsb8/pdb-tools | 2fecdebd7520505b68ab515c54fa7c128e7a8090 | [
"Apache-2.0"
] | 192 | 2015-07-25T02:31:09.000Z | 2022-03-29T11:09:45.000Z | pdbtools/pdb_chain.py | andrewsb8/pdb-tools | 2fecdebd7520505b68ab515c54fa7c128e7a8090 | [
"Apache-2.0"
] | 112 | 2016-08-16T20:00:16.000Z | 2022-03-25T00:44:16.000Z | pdbtools/pdb_chain.py | andrewsb8/pdb-tools | 2fecdebd7520505b68ab515c54fa7c128e7a8090 | [
"Apache-2.0"
] | 55 | 2015-07-24T17:33:30.000Z | 2022-03-17T17:36:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018 João Pedro Rodrigues
#
# 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
#
# Unl... | 27.988701 | 79 | 0.594267 |
import os
import sys
__author__ = "Joao Rodrigues"
__email__ = "j.p.g.l.m.rodrigues@gmail.com"
def check_input(args):
option = ' '
fh = sys.stdin
if not len(args):
if sys.stdin.isatty():
sys.stderr.write(__doc__)
sys.exit(1)
elif le... | true | true |
1c3ec22b6437fb74df647b14f9882233d4fc1589 | 18,074 | py | Python | napalm_yang/models/openconfig/network_instances/network_instance/mpls/te_interface_attributes/interface/interface_ref/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/network_instances/network_instance/mpls/te_interface_attributes/interface/interface_ref/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/network_instances/network_instance/mpls/te_interface_attributes/interface/interface_ref/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 38.619658 | 377 | 0.602302 |
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.y... | true | true |
1c3ec271455fb4a4203f0942fbcf2dc4f068a07e | 5,204 | py | Python | owlbot.py | LaudateCorpus1/python-gke-hub | 09e7c033fea2e07a6c865ac633ec14b3d07edf7a | [
"Apache-2.0"
] | null | null | null | owlbot.py | LaudateCorpus1/python-gke-hub | 09e7c033fea2e07a6c865ac633ec14b3d07edf7a | [
"Apache-2.0"
] | null | null | null | owlbot.py | LaudateCorpus1/python-gke-hub | 09e7c033fea2e07a6c865ac633ec14b3d07edf7a | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | 34.013072 | 127 | 0.64854 |
import os
import synthtool as s
import synthtool.gcp as gcp
from synthtool.languages import python
common = gcp.CommonTemplates()
default_version = "v1"
for library in s.get_staging_dirs(default_version):
submodules = [
"configmanagement",
"multiclusteringress",
]
for submodu... | true | true |
1c3ec2f91b2d99d51d3ba428e99bf769634ff906 | 1,435 | py | Python | pipeline/migrations/0012_templatecurrentversion.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | 1 | 2020-09-24T07:39:16.000Z | 2020-09-24T07:39:16.000Z | pipeline/migrations/0012_templatecurrentversion.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:46:54.000Z | 2021-06-10T22:54:45.000Z | pipeline/migrations/0012_templatecurrentversion.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 39.861111 | 125 | 0.712892 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pipeline', '0011_auto_20180906_1045'),
]
operations = [
migrations.CreateModel(
name='TemplateCurrentVersion',
fields=[
... | true | true |
1c3ec314a0794bcb54b14f7270db1ec2ee447f38 | 4,129 | py | Python | sdk/python/pulumi_aws/storagegateway/upload_buffer.py | michael-golden/pulumi-aws | 165e876e166ecab1870e857822247585d78aef64 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/storagegateway/upload_buffer.py | michael-golden/pulumi-aws | 165e876e166ecab1870e857822247585d78aef64 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/storagegateway/upload_buffer.py | michael-golden/pulumi-aws | 165e876e166ecab1870e857822247585d78aef64 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class UploadBuffer(pulu... | 42.56701 | 166 | 0.661177 |
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from .. import utilities, tables
class UploadBuffer(pulumi.CustomResource):
disk_id: pulumi.Output[str]
gateway_arn: pulumi.Output[str]
def __init__(__self__, resource_name, opts=None, disk_id=None, gateway_arn=None, __props_... | true | true |
1c3ec347f88de693871c19dc660539788c4b5eca | 540 | py | Python | PythonSolutions/763_partition_labels.py | ChuckChen2020/Leetcode | 08f98365f0fac6e4a151b557b632000a34734585 | [
"MIT"
] | null | null | null | PythonSolutions/763_partition_labels.py | ChuckChen2020/Leetcode | 08f98365f0fac6e4a151b557b632000a34734585 | [
"MIT"
] | null | null | null | PythonSolutions/763_partition_labels.py | ChuckChen2020/Leetcode | 08f98365f0fac6e4a151b557b632000a34734585 | [
"MIT"
] | null | null | null | #16:39 - 17:03
def partitionLabels(S: str):
dic = dict()
for i, c in enumerate(S):
dic[c] = i
end_pos = 0
ret = []
i = 0
while i <= len(S) - 1:
start = i
end_pos = dic[S[i]]
while i != end_pos:
end_pos = max... | 23.478261 | 54 | 0.444444 |
def partitionLabels(S: str):
dic = dict()
for i, c in enumerate(S):
dic[c] = i
end_pos = 0
ret = []
i = 0
while i <= len(S) - 1:
start = i
end_pos = dic[S[i]]
while i != end_pos:
end_pos = max(end_pos, dic[... | true | true |
1c3ec3b4bc5344c64c22185a906367a5b2c6ee1b | 3,171 | py | Python | gradientDescent.py | dddoss/neural-style-colors | 14447bd2bd022244b299d6c0be9ce7c43e6ebbfd | [
"MIT"
] | null | null | null | gradientDescent.py | dddoss/neural-style-colors | 14447bd2bd022244b299d6c0be9ce7c43e6ebbfd | [
"MIT"
] | null | null | null | gradientDescent.py | dddoss/neural-style-colors | 14447bd2bd022244b299d6c0be9ce7c43e6ebbfd | [
"MIT"
] | null | null | null | import params
import numpy as np
import tensorflow as tf
import random
from operator import mul
import scipy.misc
import vgg
#matrix style size is mxnx3 in np array format
#matrix content size is c x d
def total_loss(content_acts, style_grams, out_acts, out_grams, out_img):
#Calculate content loss
loss_conten... | 35.629213 | 114 | 0.688742 | import params
import numpy as np
import tensorflow as tf
import random
from operator import mul
import scipy.misc
import vgg
def total_loss(content_acts, style_grams, out_acts, out_grams, out_img):
loss_content = content_loss(content_acts, out_acts)
loss_style = style_loss(style_grams, out_grams)... | false | true |
1c3ec3d0cac39cf9941d9ca1c590fc595be6ee34 | 493 | py | Python | sdk/python/pulumi_azure_native/dbforpostgresql/v20210410privatepreview/__init__.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/dbforpostgresql/v20210410privatepreview/__init__.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/dbforpostgresql/v20210410privatepreview/__init__.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from ... import _utilities
import typing
# Export this package's modules as members:
from ._enums import *
from .configuration import *
from .firewall_... | 29 | 80 | 0.744422 |
from ... import _utilities
import typing
# Export this package's modules as members:
from ._enums import *
from .configuration import *
from .firewall_rule import *
from .get_configuration import *
from .get_firewall_rule import *
from .get_server import *
from .server import *
from ._inputs import *
from . import ... | true | true |
1c3ec44eeefd7593b2bd53357219e6fbeeb19a01 | 887 | py | Python | azcam_scripts/__init__.py | mplesser/azcam-scripts | 116106f98352ccfc6c97b748e361fe9dadd16888 | [
"MIT"
] | null | null | null | azcam_scripts/__init__.py | mplesser/azcam-scripts | 116106f98352ccfc6c97b748e361fe9dadd16888 | [
"MIT"
] | null | null | null | azcam_scripts/__init__.py | mplesser/azcam-scripts | 116106f98352ccfc6c97b748e361fe9dadd16888 | [
"MIT"
] | null | null | null | import importlib
import os
import azcam
def load(scripts="all") -> None:
"""
Load all scripts from folder into azcam.db.cli_tools
"""
rootpackage = "azcam_scripts"
folder = importlib.util.find_spec(rootpackage).submodule_search_locations[0]
# bring all .py modules with same function name in... | 26.088235 | 80 | 0.620068 | import importlib
import os
import azcam
def load(scripts="all") -> None:
rootpackage = "azcam_scripts"
folder = importlib.util.find_spec(rootpackage).submodule_search_locations[0]
_, _, filenames = next(os.walk(folder))
pyfiles = []
for files in filenames:
if files.endswith(".py"):... | true | true |
1c3ec44efc9d5d26cbe704b72379b94ec21eb3f6 | 8,216 | py | Python | finetune/dataloader/DataloaderApi.py | yuningkang/APIRecX | aaef5f3f0b669d7a907ddb3273e6658c9267c68a | [
"MIT"
] | null | null | null | finetune/dataloader/DataloaderApi.py | yuningkang/APIRecX | aaef5f3f0b669d7a907ddb3273e6658c9267c68a | [
"MIT"
] | null | null | null | finetune/dataloader/DataloaderApi.py | yuningkang/APIRecX | aaef5f3f0b669d7a907ddb3273e6658c9267c68a | [
"MIT"
] | null | null | null | import numpy as np
import torch
import pickle
import random
from collections import defaultdict
from torch.autograd import Variable
from GPT.data_utils import *
from GPT.tokenization import *
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
class train_data_seq:
def __init__(self,vec,tag,nu... | 38.57277 | 99 | 0.59871 | import numpy as np
import torch
import pickle
import random
from collections import defaultdict
from torch.autograd import Variable
from GPT.data_utils import *
from GPT.tokenization import *
from torch.nn.utils.rnn import pack_padded_sequence, pad_packed_sequence
class train_data_seq:
def __init__(self,vec,tag,nu... | false | true |
1c3ec5820cfff6b1650df4f4de61fd0b17c04a7e | 9,946 | py | Python | api/src/opentrons/protocol_api/legacy_wrapper/containers_wrapper.py | theosanderson/opentrons | df9f41d3dc56bd03ff0ef4e804d1224221272ddf | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocol_api/legacy_wrapper/containers_wrapper.py | theosanderson/opentrons | df9f41d3dc56bd03ff0ef4e804d1224221272ddf | [
"Apache-2.0"
] | null | null | null | api/src/opentrons/protocol_api/legacy_wrapper/containers_wrapper.py | theosanderson/opentrons | df9f41d3dc56bd03ff0ef4e804d1224221272ddf | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Any, Dict
import jsonschema # type: ignore
from opentrons.data_storage import database as db_cmds
from opentrons.protocol_api.labware import save_definition
from opentrons.config import CONFIG
from opentrons.legacy_api.containers.placeable import Container, Well
from .util import l... | 41.789916 | 133 | 0.688619 | import logging
from typing import Any, Dict
import jsonschema
from opentrons.data_storage import database as db_cmds
from opentrons.protocol_api.labware import save_definition
from opentrons.config import CONFIG
from opentrons.legacy_api.containers.placeable import Container, Well
from .util import log_call
log =... | true | true |
1c3ec62a601b2600e4683994830df9b5435985ac | 1,230 | py | Python | quizzes/00.organize.me/Cracking the Coding Interview/p101_04_hanoiTower.py | JiniousChoi/encyclopedia-in-code | 77bc551a03a2a3e3808e50016ece14adb5cfbd96 | [
"MIT"
] | 2 | 2018-07-20T10:15:49.000Z | 2018-07-20T10:16:54.000Z | quizzes/00.organize.me/Cracking the Coding Interview/p101_04_hanoiTower.py | JiniousChoi/encyclopedia-in-code | 77bc551a03a2a3e3808e50016ece14adb5cfbd96 | [
"MIT"
] | 2 | 2018-06-26T09:12:44.000Z | 2019-12-18T00:09:14.000Z | quizzes/00.organize.me/Cracking the Coding Interview/p101_04_hanoiTower.py | JiniousChoi/encyclopedia-in-code | 77bc551a03a2a3e3808e50016ece14adb5cfbd96 | [
"MIT"
] | null | null | null | count = 0
def hanoiTower(arr, fromPoint, toPoint, howmany):
if howmany<=0:
return
if howmany ==1:
stone = arr[fromPoint].pop(0)
arr[toPoint].insert(0, stone)
global count
count +=1
print count, 'th :', arr
return
detourPoint = getDetour... | 25.102041 | 52 | 0.604065 | count = 0
def hanoiTower(arr, fromPoint, toPoint, howmany):
if howmany<=0:
return
if howmany ==1:
stone = arr[fromPoint].pop(0)
arr[toPoint].insert(0, stone)
global count
count +=1
print count, 'th :', arr
return
detourPoint = getDetour... | false | true |
1c3ec6385ed9ff148175b1e4f2ec924d2e0a25ce | 55,048 | py | Python | kafka/consumer/group.py | fchartier/kafka-python | 8e1741edcf368e4eba6af6a7218f788d4aafcee8 | [
"Apache-2.0"
] | null | null | null | kafka/consumer/group.py | fchartier/kafka-python | 8e1741edcf368e4eba6af6a7218f788d4aafcee8 | [
"Apache-2.0"
] | null | null | null | kafka/consumer/group.py | fchartier/kafka-python | 8e1741edcf368e4eba6af6a7218f788d4aafcee8 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division
import copy
import logging
import socket
import time
from kafka.errors import KafkaConfigurationError, UnsupportedVersionError
from kafka.vendor import six
from kafka.client_async import KafkaClient, selectors
from kafka.consumer.fetcher import Fetcher
from kafka.con... | 47.537133 | 123 | 0.652067 | from __future__ import absolute_import, division
import copy
import logging
import socket
import time
from kafka.errors import KafkaConfigurationError, UnsupportedVersionError
from kafka.vendor import six
from kafka.client_async import KafkaClient, selectors
from kafka.consumer.fetcher import Fetcher
from kafka.con... | true | true |
1c3ec6d3f7be58abd038f8964534a0cb398cb936 | 2,732 | py | Python | blog/migrations/0011_auto_20200728_0547.py | tbrlpld/wagtail-gatsby-blog-backend | f68f1d9e2577d5271960f142bf37dcbcdac6767a | [
"MIT"
] | null | null | null | blog/migrations/0011_auto_20200728_0547.py | tbrlpld/wagtail-gatsby-blog-backend | f68f1d9e2577d5271960f142bf37dcbcdac6767a | [
"MIT"
] | null | null | null | blog/migrations/0011_auto_20200728_0547.py | tbrlpld/wagtail-gatsby-blog-backend | f68f1d9e2577d5271960f142bf37dcbcdac6767a | [
"MIT"
] | null | null | null | # Generated by Django 2.2.13 on 2020-07-28 05:47
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.blocks.static_block
import wagtail.core.fields
import wagtail.documents.blocks
import wagtail.embeds.blocks
import wagtail.images.blocks
class Migration(migrations.Migration):
depende... | 109.28 | 2,214 | 0.725842 |
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.blocks.static_block
import wagtail.core.fields
import wagtail.documents.blocks
import wagtail.embeds.blocks
import wagtail.images.blocks
class Migration(migrations.Migration):
dependencies = [
('blog', '0010_auto_20200728_0... | true | true |
1c3ec6ff7238f3a67bc7e7cbadd77b8f9696718c | 1,716 | py | Python | src/third_party/red_tamarin_stable/tamarin-cental/halfmoon/templates/sexp.py | michaelpdu/flash_feature_extraction | 29226a4c0e81240fd5c53fd9c80b0f6b0f5a8f95 | [
"Apache-2.0"
] | 1 | 2018-11-25T01:05:03.000Z | 2018-11-25T01:05:03.000Z | avmplus/halfmoon/templates/sexp.py | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | null | null | null | avmplus/halfmoon/templates/sexp.py | vidkidz/crossbridge | ba0bf94aee0ce6cf7eb5be882382e52bc57ba396 | [
"MIT"
] | 1 | 2019-04-12T04:18:27.000Z | 2019-04-12T04:18:27.000Z | #!/usr/bin/env python
# -*- Mode: Python; indent-tabs-mode: nil -*-
# vi: set ts=4 sw=4 expandtab:
# borrowed from http://gist.github.com/240957
# no license information found
# Support for comments ; added by Adobe.
from string import whitespace
atom_end = set('()"\'') | set(whitespace)
def parse(sexp):
stack,... | 33.647059 | 78 | 0.434732 |
from string import whitespace
atom_end = set('()"\'') | set(whitespace)
def parse(sexp):
stack, i, length = [[]], 0, len(sexp)
while i < length:
c = sexp[i]
#print c, stack
if c == ';':
while i + 1 < length and sexp[i + 1] != '\n':
i += 1
else:
... | true | true |
1c3ec72e9ec972f9c7d148b66f212bf3e366a340 | 2,457 | py | Python | ctgan/data.py | JonathanDZiegler/CTGAN | 7b1c110455bf776cf89a661e5ff8425d6519daf5 | [
"MIT"
] | null | null | null | ctgan/data.py | JonathanDZiegler/CTGAN | 7b1c110455bf776cf89a661e5ff8425d6519daf5 | [
"MIT"
] | null | null | null | ctgan/data.py | JonathanDZiegler/CTGAN | 7b1c110455bf776cf89a661e5ff8425d6519daf5 | [
"MIT"
] | 1 | 2021-11-18T14:23:24.000Z | 2021-11-18T14:23:24.000Z | """Data loading."""
import json
import numpy as np
import pandas as pd
def read_csv(csv_filename, meta_filename=None, header=True, discrete=None):
"""Read a csv file."""
data = pd.read_csv(csv_filename, header='infer' if header else None)
if meta_filename:
with open(meta_filename) as meta_file:... | 25.863158 | 78 | 0.553521 |
import json
import numpy as np
import pandas as pd
def read_csv(csv_filename, meta_filename=None, header=True, discrete=None):
data = pd.read_csv(csv_filename, header='infer' if header else None)
if meta_filename:
with open(meta_filename) as meta_file:
metadata = json.load(meta_file)
... | true | true |
1c3ec7572013460e6d2b8a5b43c1333c84548a2f | 5,023 | py | Python | tests/test_dependency_loop.py | TinkerBoard-Android/external-google-fruit | 57123c8a2477a4d99cb68c53d195e9fb428dd535 | [
"Apache-2.0"
] | 1,666 | 2015-01-04T08:52:43.000Z | 2022-03-28T11:06:19.000Z | tests/test_dependency_loop.py | TinkerBoard-Android/external-google-fruit | 57123c8a2477a4d99cb68c53d195e9fb428dd535 | [
"Apache-2.0"
] | 135 | 2015-02-19T11:35:07.000Z | 2022-03-29T05:00:42.000Z | tests/test_dependency_loop.py | TinkerBoard-Android/external-google-fruit | 57123c8a2477a4d99cb68c53d195e9fb428dd535 | [
"Apache-2.0"
] | 253 | 2015-01-14T08:15:10.000Z | 2022-03-24T07:49:53.000Z | #!/usr/bin/env python3
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 33.939189 | 125 | 0.565399 |
from absl.testing import parameterized
from fruit_test_common import *
COMMON_DEFINITIONS = '''
#include "test_common.h"
struct X;
struct Annotation1 {};
using XAnnot1 = fruit::Annotated<Annotation1, X>;
struct Annotation2 {};
using XAnnot2 = fruit::Annotated<Annotation2, X>;
... | true | true |
1c3ec7b6b14e02b69b8c1732d3ec1b97b07bc9d9 | 3,069 | py | Python | docs/conf.py | mollymwieringa/sit_assimilation_osses | 56eb13227cf3cf481991bd162889c49880020635 | [
"MIT"
] | null | null | null | docs/conf.py | mollymwieringa/sit_assimilation_osses | 56eb13227cf3cf481991bd162889c49880020635 | [
"MIT"
] | null | null | null | docs/conf.py | mollymwieringa/sit_assimilation_osses | 56eb13227cf3cf481991bd162889c49880020635 | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 35.275862 | 79 | 0.681981 |
import os
import pathlib
import sys
print("python exec:", sys.executable)
print("sys.path:", sys.path)
root = pathlib.Path(__file__).parent.parent.absolute()
os.environ["PYTHONPATH"] = str(root)
sys.path.insert(0, str(root))
import sit_assimilation_osses
project = "sit_assimilation_osses"
copyright ... | true | true |
1c3ec87ee1e156d9bd81c49a7f5849c9a0477607 | 466 | py | Python | data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_jacket_s10.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_jacket_s10.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/tangible/wearables/ithorian/shared_ith_jacket_s10.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/wearables/ithorian/shared_ith_jacket_s10.iff"
result.attribute_temp... | 27.411765 | 81 | 0.738197 | true | true | |
1c3ec8d51199ed160a9b1ec4dfce1a483ae737af | 816 | py | Python | profiles_project/urls.py | kienyiep/profile-rest-api | 705c3bf9c6c45f7b860cd358520a81694c2a26cb | [
"MIT"
] | null | null | null | profiles_project/urls.py | kienyiep/profile-rest-api | 705c3bf9c6c45f7b860cd358520a81694c2a26cb | [
"MIT"
] | null | null | null | profiles_project/urls.py | kienyiep/profile-rest-api | 705c3bf9c6c45f7b860cd358520a81694c2a26cb | [
"MIT"
] | null | null | null | """profiles_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Cl... | 32.64 | 77 | 0.707108 |
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('api/', include('profiles_api.urls'))
]
| true | true |
1c3ec94e2ccb841eb99eae10987aea3e9f60f21d | 11,253 | py | Python | mars/tensor/linalg/norm.py | ueshin/mars | 0b542974243be4e0ff239eaf49ab0fb2935f3361 | [
"Apache-2.0"
] | null | null | null | mars/tensor/linalg/norm.py | ueshin/mars | 0b542974243be4e0ff239eaf49ab0fb2935f3361 | [
"Apache-2.0"
] | null | null | null | mars/tensor/linalg/norm.py | ueshin/mars | 0b542974243be4e0ff239eaf49ab0fb2935f3361 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2020 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-... | 35.610759 | 105 | 0.555052 |
import itertools
from collections.abc import Iterable
import numpy as np
from ... import opcodes as OperandDef
from ...serialize import ValueType, KeyField, AnyField, TupleField, BoolField
from ..utils import recursive_tile
from ..array_utils import device, as_same_device
from ..operands import Tensor... | true | true |
1c3ecac895f332fe1a4efb3869906afedc532dea | 953 | py | Python | examples/active_learning/plot_perf.py | sudodoki/trunklucator | 7d5a96d650a50e62b3ad479f72de8d60790e93a8 | [
"Apache-2.0"
] | null | null | null | examples/active_learning/plot_perf.py | sudodoki/trunklucator | 7d5a96d650a50e62b3ad479f72de8d60790e93a8 | [
"Apache-2.0"
] | null | null | null | examples/active_learning/plot_perf.py | sudodoki/trunklucator | 7d5a96d650a50e62b3ad479f72de8d60790e93a8 | [
"Apache-2.0"
] | null | null | null | import matplotlib as mpl
import matplotlib.pyplot as plt
from io import BytesIO
import base64
mpl.use('Agg')
def plot_performance(performance_history):
fig, ax = plt.subplots(figsize=(8.5, 6), dpi=130)
ax.plot(performance_history)
ax.scatter(range(len(performance_history)), performance_history, s=13)
... | 30.741935 | 122 | 0.716684 | import matplotlib as mpl
import matplotlib.pyplot as plt
from io import BytesIO
import base64
mpl.use('Agg')
def plot_performance(performance_history):
fig, ax = plt.subplots(figsize=(8.5, 6), dpi=130)
ax.plot(performance_history)
ax.scatter(range(len(performance_history)), performance_history, s=13)
... | true | true |
1c3ecaf3fc8f8dbaf8239f589fe967fdd4055863 | 1,757 | py | Python | kirppuauth/migrations/0002_auto_20160127_2212.py | tracon/kirppu | 65c926daa6138b14268693eeac6e6e517a3cd96b | [
"MIT"
] | null | null | null | kirppuauth/migrations/0002_auto_20160127_2212.py | tracon/kirppu | 65c926daa6138b14268693eeac6e6e517a3cd96b | [
"MIT"
] | 6 | 2017-02-03T07:42:57.000Z | 2019-12-23T14:25:15.000Z | kirppuauth/migrations/0002_auto_20160127_2212.py | tracon/kirppu | 65c926daa6138b14268693eeac6e6e517a3cd96b | [
"MIT"
] | 6 | 2015-01-26T22:27:26.000Z | 2019-01-20T21:57:51.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
import django.contrib.auth.models
class Migration(migrations.Migration):
dependencies = [
('kirppuauth', '0001_initial'),
]
operations = [
migrations.Al... | 40.860465 | 420 | 0.623221 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.validators
import django.contrib.auth.models
class Migration(migrations.Migration):
dependencies = [
('kirppuauth', '0001_initial'),
]
operations = [
migrations.AlterModelManagers(
... | true | true |
1c3ecb6add03b7112c2dee8c497792a4df9841d8 | 512 | py | Python | gaphor/UML/interactions/__init__.py | bertob/gaphor | a1d6f8dd8c878f299980bba6c055436148573274 | [
"Apache-2.0"
] | 867 | 2018-01-09T00:19:09.000Z | 2022-03-31T02:49:23.000Z | gaphor/UML/interactions/__init__.py | burakozturk16/gaphor | 86267a5200ac4439626d35d306dbb376c3800107 | [
"Apache-2.0"
] | 790 | 2018-01-13T23:47:07.000Z | 2022-03-31T16:04:27.000Z | gaphor/UML/interactions/__init__.py | burakozturk16/gaphor | 86267a5200ac4439626d35d306dbb376c3800107 | [
"Apache-2.0"
] | 117 | 2018-01-09T02:24:49.000Z | 2022-03-23T08:07:42.000Z | from gaphor.UML.interactions import (
copypaste,
interactionsconnect,
interactionsgrouping,
interactionspropertypages,
)
from gaphor.UML.interactions.executionspecification import ExecutionSpecificationItem
from gaphor.UML.interactions.interaction import InteractionItem
from gaphor.UML.interactions.life... | 28.444444 | 85 | 0.802734 | from gaphor.UML.interactions import (
copypaste,
interactionsconnect,
interactionsgrouping,
interactionspropertypages,
)
from gaphor.UML.interactions.executionspecification import ExecutionSpecificationItem
from gaphor.UML.interactions.interaction import InteractionItem
from gaphor.UML.interactions.life... | true | true |
1c3eccd21ed61850063af3310f191383d5b82a5d | 19,887 | py | Python | inventories/digitalocean/digital_ocean.py | polycliniqueborinage/vagrant_ansible | 981877dae9359029d79c5137185c3b241e9873ff | [
"MIT"
] | 3 | 2016-01-04T20:41:30.000Z | 2016-12-09T18:48:13.000Z | digital_ocean.py | thiagoramos23/ansible_jenkins | 1bbc9761402ebc3c60fa6564c2fe73b08bc3b497 | [
"MIT"
] | 19 | 2017-10-25T17:54:23.000Z | 2019-09-08T14:37:03.000Z | digital_ocean.py | thiagoramos23/ansible_jenkins | 1bbc9761402ebc3c60fa6564c2fe73b08bc3b497 | [
"MIT"
] | 2 | 2018-06-14T16:20:52.000Z | 2020-11-19T14:09:41.000Z | #!/usr/bin/env python
'''
DigitalOcean external inventory script
======================================
Generates Ansible inventory of DigitalOcean Droplets.
In addition to the --list and --host options used by Ansible, there are options
for generating JSON of other DigitalOcean data. This is useful when creating
d... | 40.752049 | 192 | 0.601398 |
'''
DigitalOcean external inventory script
======================================
Generates Ansible inventory of DigitalOcean Droplets.
In addition to the --list and --host options used by Ansible, there are options
for generating JSON of other DigitalOcean data. This is useful when creating
droplets. For example... | false | true |
1c3ecced193917d21de696859842864904d72d87 | 3,649 | py | Python | benchmarks/kvbench/novelsm/novelsm.py | huangvincent170/cyclone | 737af617ab1472dfb16e6c20a079e88dccf85850 | [
"Apache-2.0"
] | 2 | 2019-04-16T01:33:36.000Z | 2021-02-23T08:34:38.000Z | benchmarks/kvbench/novelsm/novelsm.py | huangvincent170/cyclone | 737af617ab1472dfb16e6c20a079e88dccf85850 | [
"Apache-2.0"
] | null | null | null | benchmarks/kvbench/novelsm/novelsm.py | huangvincent170/cyclone | 737af617ab1472dfb16e6c20a079e88dccf85850 | [
"Apache-2.0"
] | 4 | 2020-03-27T18:06:33.000Z | 2021-03-24T09:56:17.000Z | def launch_cmds_startup():
print("Configuring for rocksdb application")
def launch_cmds_server_gen(f, q, r, m, quorums, replicas, clients, ports):
passwd=''
if os.environ.has_key('CYCLONE_PASS'):
passwd=os.environ.get('CYCLONE_PASS')
cmd= ' echo ' + passwd + ' | sudo -S '
cmd=cmd + 'rm -rf... | 45.049383 | 128 | 0.580433 | def launch_cmds_startup():
print("Configuring for rocksdb application")
def launch_cmds_server_gen(f, q, r, m, quorums, replicas, clients, ports):
passwd=''
if os.environ.has_key('CYCLONE_PASS'):
passwd=os.environ.get('CYCLONE_PASS')
cmd= ' echo ' + passwd + ' | sudo -S '
cmd=cmd + 'rm -rf... | true | true |
1c3eccfe5a2a05938061228955cc2ec0f6627de9 | 73,105 | py | Python | packages/python/plotly/plotly/graph_objs/cone/_colorbar.py | eisenlohr/plotly.py | 3b0e3df45036cf48f772b13bcc10ce347964aefc | [
"MIT"
] | 1 | 2021-12-11T07:01:40.000Z | 2021-12-11T07:01:40.000Z | packages/python/plotly/plotly/graph_objs/cone/_colorbar.py | jiangrongbo/plotly.py | df19fc702b309586cc24e25373b87e8bdbb3ff60 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/cone/_colorbar.py | jiangrongbo/plotly.py | df19fc702b309586cc24e25373b87e8bdbb3ff60 | [
"MIT"
] | 1 | 2021-11-29T22:55:05.000Z | 2021-11-29T22:55:05.000Z | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "cone"
_path_str = "cone.colorbar"
_valid_props = {
"bgcolor",
"bordercolor... | 35.643588 | 90 | 0.557582 | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
_parent_path_str = "cone"
_path_str = "cone.colorbar"
_valid_props = {
"bgcolor",
"bordercolor",
"borderwidth",
"dtick... | true | true |
1c3ecd48137353b90db4a7570b4ac12b3113cd43 | 218 | py | Python | catalyst/contrib/criterion/__init__.py | ferrine/catalyst | b5bc4fb5f692e1fde2d95ef4a534296dccd0f717 | [
"MIT"
] | null | null | null | catalyst/contrib/criterion/__init__.py | ferrine/catalyst | b5bc4fb5f692e1fde2d95ef4a534296dccd0f717 | [
"MIT"
] | null | null | null | catalyst/contrib/criterion/__init__.py | ferrine/catalyst | b5bc4fb5f692e1fde2d95ef4a534296dccd0f717 | [
"MIT"
] | null | null | null | # flake8: noqa
from torch.nn import *
from .bcece import *
from .ce import *
from .center_loss import *
from .contrastive import *
from .dice import *
from .focal_loss import *
from .huber import *
from .unet import *
| 19.818182 | 26 | 0.729358 |
from torch.nn import *
from .bcece import *
from .ce import *
from .center_loss import *
from .contrastive import *
from .dice import *
from .focal_loss import *
from .huber import *
from .unet import *
| true | true |
1c3ecd98fcb15ba4a6f5bccae63e6e80e435759b | 9,412 | py | Python | vulnerabilities/importers/rust.py | anshsrtv/vulnerablecode | b79117f3ea50470547aa2a173265aa4e89403b50 | [
"Apache-2.0"
] | null | null | null | vulnerabilities/importers/rust.py | anshsrtv/vulnerablecode | b79117f3ea50470547aa2a173265aa4e89403b50 | [
"Apache-2.0"
] | null | null | null | vulnerabilities/importers/rust.py | anshsrtv/vulnerablecode | b79117f3ea50470547aa2a173265aa4e89403b50 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/vulnerablecode/
# The VulnerableCode software is licensed under the Apache License version 2.0.
# Data generated with VulnerableCode require an acknowledgment.
#
# You may not use this software except in compli... | 36.061303 | 100 | 0.657777 |
import asyncio
import re
from itertools import chain
from typing import Optional
from typing import Mapping
from typing import List
from typing import Set
from typing import Tuple
from urllib.error import HTTPError
from urllib.request import urlopen
import toml
from univers.version_specifier impo... | true | true |
1c3ecdaaf358b3e1ac6e7c89f30b3b9afcab7ca7 | 1,820 | py | Python | regulations/tests/generator_subterp_tests.py | navigo/regulations-site | 910c24e46f4e921210a40da452dff69feae692d4 | [
"CC0-1.0"
] | 18 | 2015-01-14T15:58:45.000Z | 2019-08-17T06:15:59.000Z | regulations/tests/generator_subterp_tests.py | navigo/regulations-site | 910c24e46f4e921210a40da452dff69feae692d4 | [
"CC0-1.0"
] | 260 | 2016-04-05T22:06:10.000Z | 2021-01-07T22:08:15.000Z | regulations/tests/generator_subterp_tests.py | navigo/regulations-site | 910c24e46f4e921210a40da452dff69feae692d4 | [
"CC0-1.0"
] | 45 | 2015-01-26T16:24:46.000Z | 2021-02-20T10:50:59.000Z | from unittest import TestCase
from mock import patch
from regulations.generator import subterp
class SubterpTest(TestCase):
@patch('regulations.generator.subterp.fetch_toc')
def test_filter_by_subterp(self, fetch_toc):
nodes = [{'label': ['1005', 'h1', 'Interp']},
{'label': ['1005',... | 44.390244 | 78 | 0.482967 | from unittest import TestCase
from mock import patch
from regulations.generator import subterp
class SubterpTest(TestCase):
@patch('regulations.generator.subterp.fetch_toc')
def test_filter_by_subterp(self, fetch_toc):
nodes = [{'label': ['1005', 'h1', 'Interp']},
{'label': ['1005',... | true | true |
1c3ece1119d3406c43d3f2ded5d89016c2782b23 | 7,500 | py | Python | moses/contrib/arrow-pipelines/python/manager.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | 3 | 2018-01-25T00:51:56.000Z | 2022-01-07T15:09:38.000Z | moses/contrib/arrow-pipelines/python/manager.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | 1 | 2021-11-25T18:08:22.000Z | 2021-11-25T18:08:22.000Z | moses/contrib/arrow-pipelines/python/manager.py | anshsarkar/TailBench | 25845756aee9a892229c25b681051591c94daafd | [
"MIT"
] | 3 | 2018-06-08T08:36:27.000Z | 2021-12-26T20:36:16.000Z | import logging
import os
from concurrent.futures import Future, ThreadPoolExecutor
from functools import partial
from pypeline.helpers.parallel_helpers import eval_pipeline, \
cons_function_component, \
cons_wire, \
cons_split_wire, \
cons_unsplit_wire, \
cons_dictionary_wire
#
# Some logging ple... | 38.860104 | 124 | 0.637333 | import logging
import os
from concurrent.futures import Future, ThreadPoolExecutor
from functools import partial
from pypeline.helpers.parallel_helpers import eval_pipeline, \
cons_function_component, \
cons_wire, \
cons_split_wire, \
cons_unsplit_wire, \
cons_dictionary_wire
FORMAT = '%(ascti... | true | true |
1c3ece2c42a04a5c61f6788d458259f9c5c0c5cc | 5,260 | py | Python | tests/python/unittest/test_codegen_device.py | zhanghaohit/incubator-tvm | ee0af843f3c5a3429e888079afb5f30789bd9bee | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 2 | 2019-01-07T06:00:27.000Z | 2019-02-28T15:07:16.000Z | tests/python/unittest/test_codegen_device.py | zhanghaohit/incubator-tvm | ee0af843f3c5a3429e888079afb5f30789bd9bee | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 4 | 2021-03-30T11:59:59.000Z | 2022-03-12T00:40:23.000Z | tests/python/unittest/test_codegen_device.py | zhanghaohit/incubator-tvm | ee0af843f3c5a3429e888079afb5f30789bd9bee | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 3 | 2021-07-20T07:40:15.000Z | 2021-08-03T08:39:17.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.783217 | 82 | 0.619962 |
import tvm
from tvm.contrib import util
import numpy as np
def test_large_uint_imm():
value = (1 << 63) + 123
other = tvm.const(3, "uint64")
n = 12
num_thread = 2
A = tvm.compute((n,), lambda *i: tvm.const(value, "uint64") + other, name='A')
s = tvm.create_schedule(A.op)
x... | true | true |
1c3ecf27e6ed0d2f16c459636707fbe1dbed8674 | 4,553 | py | Python | notebooks/kf-1.0-workshop.py | zaxcie/flower_workshop | c879b9e1687e786a1510a640e1b1680375dff172 | [
"FTL"
] | null | null | null | notebooks/kf-1.0-workshop.py | zaxcie/flower_workshop | c879b9e1687e786a1510a640e1b1680375dff172 | [
"FTL"
] | null | null | null | notebooks/kf-1.0-workshop.py | zaxcie/flower_workshop | c879b9e1687e786a1510a640e1b1680375dff172 | [
"FTL"
] | null | null | null | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:light
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.3'
# jupytext_version: 0.8.1
# kernelspec:
# display_name: Python (dl)
# language: python
# name: dl
# langua... | 23.963158 | 120 | 0.682627 |
tory(
directory=r"data/processed/train",
target_size=(299, 299),
color_mode="rgb",
batch_size=32,
class_mode="categorical",
shuffle=True,
seed=966
)
val_generator = val_datagen.flow_from_directory(
directory=r"data/processed/val",
target_size=(299, 299),
... | true | true |
1c3ed05ee52038ba5c0bd1bdc2585a78b8cf946e | 492 | py | Python | src/coop_assembly/__version__.py | createchaos/coop_assembly | 71108b0639323cf3d996d63b0f702d45f4d60d67 | [
"MIT"
] | 3 | 2019-09-21T09:20:15.000Z | 2020-02-12T21:53:07.000Z | src/coop_assembly/__version__.py | createchaos/coop_assembly | 71108b0639323cf3d996d63b0f702d45f4d60d67 | [
"MIT"
] | null | null | null | src/coop_assembly/__version__.py | createchaos/coop_assembly | 71108b0639323cf3d996d63b0f702d45f4d60d67 | [
"MIT"
] | 1 | 2019-12-18T12:51:08.000Z | 2019-12-18T12:51:08.000Z | __title__ = 'coop_assembly'
__description__ = 'Geometry generation of robotically assembled spatial structures'
__url__ = 'https://github.com/createchaos/coop_assembly'
__version__ = '0.0.1'
__author__ = 'Stefana Parascho'
__author_email__ = 'parascho@princeton.edu'
__license__ = 'MIT license'
__copyright__ = 'Copyrigh... | 41 | 83 | 0.762195 | __title__ = 'coop_assembly'
__description__ = 'Geometry generation of robotically assembled spatial structures'
__url__ = 'https://github.com/createchaos/coop_assembly'
__version__ = '0.0.1'
__author__ = 'Stefana Parascho'
__author_email__ = 'parascho@princeton.edu'
__license__ = 'MIT license'
__copyright__ = 'Copyrigh... | true | true |
1c3ed1847f6aa6d5eb851011932ff553610206dd | 12,107 | py | Python | tracer/android_tracer.py | XTechnologyTR/appmon | 974418b80e2a3d49278b3acb2c86651894260dda | [
"Apache-2.0"
] | 1,392 | 2016-04-29T13:31:53.000Z | 2022-03-31T07:40:50.000Z | tracer/android_tracer.py | XTechnologyTR/appmon | 974418b80e2a3d49278b3acb2c86651894260dda | [
"Apache-2.0"
] | 105 | 2016-04-29T12:13:18.000Z | 2022-03-24T17:27:58.000Z | tracer/android_tracer.py | XTechnologyTR/appmon | 974418b80e2a3d49278b3acb2c86651894260dda | [
"Apache-2.0"
] | 298 | 2016-04-29T12:03:15.000Z | 2022-03-25T13:45:01.000Z | #!/usr/bin/python
###
# Copyright (c) 2016 Nishant Das Patnaik.
#
# 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 b... | 37.252308 | 416 | 0.563971 |
mport os, sys, frida, re, argparse, codecs, json
from termcolor import colored
print("""
___ .______ .______ .___ ___. ______ .__ __.
/ \ | _ \ | _ \ | \/ | / __ \ | \ | |
/ ^ \ | |_) | | |_) | | \ / | | | | | | \| |
/... | true | true |
1c3ed2bf9c387aab43e5622dc881396402695b4f | 8,064 | py | Python | pollbot/telegram/job.py | annihilatorrrr/ultimate-poll-bot | 7ecd1c0ac09a01bd4224c654bf951196dfb0207c | [
"MIT"
] | 112 | 2019-06-11T17:52:57.000Z | 2022-03-18T00:05:21.000Z | pollbot/telegram/job.py | annihilatorrrr/ultimate-poll-bot | 7ecd1c0ac09a01bd4224c654bf951196dfb0207c | [
"MIT"
] | 91 | 2019-05-28T11:33:40.000Z | 2022-02-27T12:12:07.000Z | pollbot/telegram/job.py | annihilatorrrr/ultimate-poll-bot | 7ecd1c0ac09a01bd4224c654bf951196dfb0207c | [
"MIT"
] | 69 | 2019-07-10T16:58:06.000Z | 2022-03-30T22:09:44.000Z | """Handle messages."""
from datetime import date, datetime, timedelta
from sqlalchemy import or_
from sqlalchemy.orm import joinedload
from sqlalchemy.orm.exc import ObjectDeletedError, StaleDataError
from sqlalchemy.orm.scoping import scoped_session
from telegram.error import BadRequest, RetryAfter, Unauthorized
from... | 36.324324 | 96 | 0.625868 | from datetime import date, datetime, timedelta
from sqlalchemy import or_
from sqlalchemy.orm import joinedload
from sqlalchemy.orm.exc import ObjectDeletedError, StaleDataError
from sqlalchemy.orm.scoping import scoped_session
from telegram.error import BadRequest, RetryAfter, Unauthorized
from telegram.ext.callbackc... | true | true |
1c3ed32e53fa0dfa1d1ba7876f61cbf18edade25 | 5,090 | py | Python | utils.py | smitkiri/nypd-misconduct-dashboard | 2b16d24f33bab7f3b09e8a068a2bb7233d978928 | [
"MIT"
] | 2 | 2020-09-12T00:13:03.000Z | 2020-12-05T07:01:04.000Z | utils.py | smitkiri/nypd-misconduct-dashboard | 2b16d24f33bab7f3b09e8a068a2bb7233d978928 | [
"MIT"
] | null | null | null | utils.py | smitkiri/nypd-misconduct-dashboard | 2b16d24f33bab7f3b09e8a068a2bb7233d978928 | [
"MIT"
] | 1 | 2020-08-24T16:05:25.000Z | 2020-08-24T16:05:25.000Z | import pandas as pd
import pickle
import plotly.graph_objs as go
def get_command(x, command_key):
try:
command = command_key[x]
except:
command = float('nan')
return command
def get_command_key():
#Get command abbreviations
command_df = pd.read_excel('NYPD-Misconduct-Complaint-Dat... | 38.560606 | 133 | 0.644401 | import pandas as pd
import pickle
import plotly.graph_objs as go
def get_command(x, command_key):
try:
command = command_key[x]
except:
command = float('nan')
return command
def get_command_key():
command_df = pd.read_excel('NYPD-Misconduct-Complaint-Database-Updated/CCRB Filespe... | true | true |
1c3ed46d063c4579b35ae4dbdad3ad13ad8a9ac0 | 3,072 | py | Python | indico/core/signals/event/registration.py | tobiashuste/indico | c1e6ec0c8c84745988e38c9b1768142a6feb9e0e | [
"MIT"
] | null | null | null | indico/core/signals/event/registration.py | tobiashuste/indico | c1e6ec0c8c84745988e38c9b1768142a6feb9e0e | [
"MIT"
] | null | null | null | indico/core/signals/event/registration.py | tobiashuste/indico | c1e6ec0c8c84745988e38c9b1768142a6feb9e0e | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from blinker import Namespace
_signals = Namespace()
registrat... | 39.384615 | 103 | 0.77181 |
from __future__ import unicode_literals
from blinker import Namespace
_signals = Namespace()
registration_personal_data_modified = _signals.signal('registration-personal-data-modified', """
Called when the registration personal data is modified. The `sender` is the
`Registration` object; the change is passed... | true | true |
1c3ed4b0cc5ab9bf06582c115f4991fc26fb456c | 260 | py | Python | examples/optimizers/create_hs.py | macoldibelli/opytimizer | ca0574d520ecc17b1ac875bc6271d466c88d18ac | [
"MIT"
] | null | null | null | examples/optimizers/create_hs.py | macoldibelli/opytimizer | ca0574d520ecc17b1ac875bc6271d466c88d18ac | [
"MIT"
] | null | null | null | examples/optimizers/create_hs.py | macoldibelli/opytimizer | ca0574d520ecc17b1ac875bc6271d466c88d18ac | [
"MIT"
] | null | null | null | from opytimizer.optimizers.hs import HS
# One should declare a hyperparameters object based
# on the desired algorithm that will be used
hyperparams = {
'HMCR': 0.7,
'PAR': 0.7,
'bw': 1
}
# Creating a HS optimizer
o = HS(hyperparams=hyperparams)
| 20 | 51 | 0.7 | from opytimizer.optimizers.hs import HS
hyperparams = {
'HMCR': 0.7,
'PAR': 0.7,
'bw': 1
}
o = HS(hyperparams=hyperparams)
| true | true |
1c3ed4e4aa189e8f3b5dd4ac4dc4bebe37005692 | 592 | py | Python | imperial/imperial/core/util/rc_style.py | jorgesaw/imperial | ed4d33d1bcc71eb5f497b3cfed52d1fed48b0a7a | [
"Unlicense"
] | null | null | null | imperial/imperial/core/util/rc_style.py | jorgesaw/imperial | ed4d33d1bcc71eb5f497b3cfed52d1fed48b0a7a | [
"Unlicense"
] | null | null | null | imperial/imperial/core/util/rc_style.py | jorgesaw/imperial | ed4d33d1bcc71eb5f497b3cfed52d1fed48b0a7a | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Created on 12/02/2015
@author: jorgesaw
'''
from __future__ import absolute_import, print_function, unicode_literals
import logging
logger = logging.getLogger()
def cargarStyleSheet(f):
"""Carga un fichero de estilos si existe, sino devuelve una cadena vacía."""
... | 24.666667 | 80 | 0.609797 |
'''
Created on 12/02/2015
@author: jorgesaw
'''
from __future__ import absolute_import, print_function, unicode_literals
import logging
logger = logging.getLogger()
def cargarStyleSheet(f):
"""Carga un fichero de estilos si existe, sino devuelve una cadena vacía."""
style = None
if f:
try:... | false | true |
1c3ed5c4ddde80567b53059419d01c45b6cac254 | 634 | py | Python | Amelie/pack_feature_vector_cdll.py | HuMingqi/Amelie_S | 1044441d0a302b4833fe6aab0f177fdf89443623 | [
"MIT"
] | null | null | null | Amelie/pack_feature_vector_cdll.py | HuMingqi/Amelie_S | 1044441d0a302b4833fe6aab0f177fdf89443623 | [
"MIT"
] | null | null | null | Amelie/pack_feature_vector_cdll.py | HuMingqi/Amelie_S | 1044441d0a302b4833fe6aab0f177fdf89443623 | [
"MIT"
] | null | null | null | import ctypes
#locate .dll file. using absolute path in django. relative path just in python intertive mode
#!!! feature_vector depend on opencv_world310d.dll , you can include it in system32
dll_path="G:/ResearchTraining/Amelie_Server/DLLS/feature_vector.dll"
#dll_path="D:/Clothes Search System/AmelieServer/DL... | 33.368421 | 94 | 0.782334 | import ctypes
dll_path="G:/ResearchTraining/Amelie_Server/DLLS/feature_vector.dll"
dll=ctypes.CDLL(dll_path)
get_feature_vector=dll.get_feature_vector
get_feature_vector.argtypes=(ctypes.c_double*24,ctypes.c_char_p)
| true | true |
1c3ed60041bd004a3090a6f1457dc9479b8f6e65 | 2,196 | py | Python | tests/unit/test_integration.py | shogo82148/acme-cert-updater | 4693ef2e96654c2eba199dd84635d1b87264ec48 | [
"MIT"
] | 9 | 2019-03-10T11:02:11.000Z | 2021-07-02T12:39:59.000Z | tests/unit/test_integration.py | shogo82148/acme-cert-updater | 4693ef2e96654c2eba199dd84635d1b87264ec48 | [
"MIT"
] | 58 | 2019-08-12T05:37:34.000Z | 2022-03-25T10:35:55.000Z | tests/unit/test_integration.py | shogo82148/acme-cert-updater | 4693ef2e96654c2eba199dd84635d1b87264ec48 | [
"MIT"
] | 1 | 2021-09-16T00:29:26.000Z | 2021-09-16T00:29:26.000Z | """tests of acme-cert-updater"""
import unittest
import secrets
import traceback
import boto3
from typing import List
from updater import app
# pylint: disable=missing-docstring
AUTHOR_ACCOUNT = '445285296882'
class DummyConfig:
def __init__(self):
self._prefix = secrets.token_hex(16)
@property
... | 24.4 | 105 | 0.624317 |
import unittest
import secrets
import traceback
import boto3
from typing import List
from updater import app
AUTHOR_ACCOUNT = '445285296882'
class DummyConfig:
def __init__(self):
self._prefix = secrets.token_hex(16)
@property
def domains(self) -> List[str]:
return ['shogo82148.com', ... | true | true |
1c3ed6c03b8fe64c7476a5230fcf005cc7c91298 | 31,311 | py | Python | language/mentionmemory/modules/mention_losses_test.py | urikz/language | 503aca178c98fed4c606cf83e58ae0f84012a4d9 | [
"Apache-2.0"
] | 1,199 | 2018-10-16T01:30:18.000Z | 2022-03-31T21:05:24.000Z | language/mentionmemory/modules/mention_losses_test.py | urikz/language | 503aca178c98fed4c606cf83e58ae0f84012a4d9 | [
"Apache-2.0"
] | 116 | 2018-10-18T03:31:46.000Z | 2022-03-24T13:40:50.000Z | language/mentionmemory/modules/mention_losses_test.py | urikz/language | 503aca178c98fed4c606cf83e58ae0f84012a4d9 | [
"Apache-2.0"
] | 303 | 2018-10-22T12:35:12.000Z | 2022-03-27T17:38:17.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 43.976124 | 83 | 0.67414 |
import functools
from absl.testing import absltest
from absl.testing import parameterized
import jax
import jax.numpy as jnp
import language.mentionmemory.modules.mention_losses as mention_losses
from language.mentionmemory.utils import mention_utils
from language.mentionmemory.utils import test_utils
i... | true | true |
1c3ed72bc6c644886efad8191a3375ad2c5fc776 | 17,558 | py | Python | src/pip/_internal/resolution/legacy/resolver.py | lhchavez/pip | bd5ac261c0bf4c9a37322b2cfe1b2564479f56ad | [
"MIT"
] | 2 | 2021-11-11T10:44:41.000Z | 2022-03-29T17:18:30.000Z | src/pip/_internal/resolution/legacy/resolver.py | illia-v/pip | 76cd70ac42cbbe6a51d83bd100f500ac4c21f26b | [
"MIT"
] | 3 | 2021-12-16T17:05:16.000Z | 2022-03-14T21:51:36.000Z | src/pip/_internal/resolution/legacy/resolver.py | illia-v/pip | 76cd70ac42cbbe6a51d83bd100f500ac4c21f26b | [
"MIT"
] | null | null | null | """Dependency Resolution
The dependency resolution in pip is performed as follows:
for top-level requirements:
a. only one spec allowed per project, regardless of conflicts or not.
otherwise a "double requirement" exception is raised
b. they override sub-dependency requirements.
for sub-dependencies
... | 38.674009 | 87 | 0.651498 |
import logging
import sys
from collections import defaultdict
from itertools import chain
from typing import DefaultDict, Iterable, List, Optional, Set, Tuple
from pip._vendor.packaging import specifiers
from pip._vendor.pkg_resources import Distribution
from pip._internal.cache import WheelCache
from pip._intern... | true | true |
1c3edbaee88f4ef3b685314892ef219d9fb001ea | 4,083 | py | Python | dolo/tests/test_splines.py | christophe-gouel/dolo | d9aef6d78d19899e2669e49ee6b7ad9aacf0e35d | [
"BSD-2-Clause"
] | null | null | null | dolo/tests/test_splines.py | christophe-gouel/dolo | d9aef6d78d19899e2669e49ee6b7ad9aacf0e35d | [
"BSD-2-Clause"
] | null | null | null | dolo/tests/test_splines.py | christophe-gouel/dolo | d9aef6d78d19899e2669e49ee6b7ad9aacf0e35d | [
"BSD-2-Clause"
] | null | null | null | #
# if __name__ == '__main__':
#
# from dolo.numeric.interpolation.splines import MultivariateSplines
# from dolo.numeric.interpolation.multilinear import MultilinearInterpolator
#
#
# import numpy as np
#
# N_grid = 20
# N_fine_grid = 50
# d = 3
#
# smin = np.array( [0.0]*d )
# smax = n... | 30.470149 | 113 | 0.532697 | true | true | |
1c3edc1a9535df18cdc85a59a9b87070c0014d91 | 3,535 | py | Python | scripts/mixexpDemo.py | karalleyna/pyprobml | 72195e46fdffc4418910e76d02e3d6469f4ce272 | [
"MIT"
] | 2 | 2021-06-22T05:43:25.000Z | 2021-06-22T08:40:16.000Z | scripts/mixexpDemo.py | Rebeca98/pyprobml | 2a4b9a267f64720cbba35dfa41af3e995ea006ca | [
"MIT"
] | null | null | null | scripts/mixexpDemo.py | Rebeca98/pyprobml | 2a4b9a267f64720cbba35dfa41af3e995ea006ca | [
"MIT"
] | 1 | 2021-06-21T01:18:07.000Z | 2021-06-21T01:18:07.000Z | import pyprobml_utils as pml
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.special import logsumexp
from sklearn.linear_model import LinearRegression
from scipy.stats import multivariate_normal
n = 200
np.random.seed(1)
y = np.random.rand(n, 1)
eta = np.random.randn(n,1)*0.05
x = y ... | 25.80292 | 88 | 0.596322 | import pyprobml_utils as pml
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from scipy.special import logsumexp
from sklearn.linear_model import LinearRegression
from scipy.stats import multivariate_normal
n = 200
np.random.seed(1)
y = np.random.rand(n, 1)
eta = np.random.randn(n,1)*0.05
x = y ... | true | true |
1c3edd0047b74206ceda57dd243e48dfb9db1917 | 2,637 | py | Python | fairseq/optim/lr_scheduler/fixed_schedule.py | kayoyin/DialogueMT | aa426ebcdbdfe0366ed06081a842945f2108e85f | [
"MIT"
] | 112 | 2021-01-04T13:19:24.000Z | 2022-03-23T21:49:00.000Z | fairseq/optim/lr_scheduler/fixed_schedule.py | kayoyin/DialogueMT | aa426ebcdbdfe0366ed06081a842945f2108e85f | [
"MIT"
] | 21 | 2021-03-18T09:39:00.000Z | 2022-03-22T09:41:48.000Z | fairseq/optim/lr_scheduler/fixed_schedule.py | kayoyin/DialogueMT | aa426ebcdbdfe0366ed06081a842945f2108e85f | [
"MIT"
] | 19 | 2021-01-28T08:07:03.000Z | 2022-03-31T08:31:36.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from . import FairseqLRScheduler, register_lr_scheduler
@register_lr_scheduler('fixed')
class FixedSchedule(FairseqLRScheduler):
"""Deca... | 38.217391 | 93 | 0.618127 |
from . import FairseqLRScheduler, register_lr_scheduler
@register_lr_scheduler('fixed')
class FixedSchedule(FairseqLRScheduler):
def __init__(self, args, optimizer):
super().__init__(args, optimizer)
args.warmup_updates = getattr(args, 'warmup_updates', 0) or 0
self.lr = a... | true | true |
1c3edd7dc690e18f8c678b526484905b94fc01d9 | 1,144 | py | Python | py/leetcode/RedundantConnection.py | danyfang/SourceCode | 8168f6058648f2a330a7354daf3a73a4d8a4e730 | [
"MIT"
] | null | null | null | py/leetcode/RedundantConnection.py | danyfang/SourceCode | 8168f6058648f2a330a7354daf3a73a4d8a4e730 | [
"MIT"
] | null | null | null | py/leetcode/RedundantConnection.py | danyfang/SourceCode | 8168f6058648f2a330a7354daf3a73a4d8a4e730 | [
"MIT"
] | null | null | null | '''
Leetcode problem No 684 Redundant Connection
Solution written by Xuqiang Fang on 12 June, 2018
'''
class Solution(object):
'''
union find
'''
def findRedundantConnection(self, edge):
n = len(edge)
p = [0 for x in range(n+1)]
s = [1 for x in range(n+1)]
for e in edge... | 24.869565 | 49 | 0.434441 |
class Solution(object):
def findRedundantConnection(self, edge):
n = len(edge)
p = [0 for x in range(n+1)]
s = [1 for x in range(n+1)]
for e in edge:
u = e[0]; v = e[1]
if p[u] == 0:
p[u] = u
if p[v] == 0:
p[v] = v
... | true | true |
1c3edeaa50330434fd48e38aa8cbe9af373be385 | 35 | py | Python | OOP/OOP-Practice/underscore/main.py | siddhantdixit/OOP-ClassWork | ce414a3836d03aa7dee0eb1d7a69e849fb6707c0 | [
"MIT"
] | null | null | null | OOP/OOP-Practice/underscore/main.py | siddhantdixit/OOP-ClassWork | ce414a3836d03aa7dee0eb1d7a69e849fb6707c0 | [
"MIT"
] | null | null | null | OOP/OOP-Practice/underscore/main.py | siddhantdixit/OOP-ClassWork | ce414a3836d03aa7dee0eb1d7a69e849fb6707c0 | [
"MIT"
] | null | null | null | from prob import *
Pref()._myfunc() | 17.5 | 18 | 0.714286 | from prob import *
Pref()._myfunc() | true | true |
1c3edfd0a7ee08c38a2c867ee1df04078c23142d | 448 | py | Python | data/scripts/templates/object/mobile/shared_nightspider_aggressor.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_nightspider_aggressor.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_nightspider_aggressor.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 = Creature()
result.template = "object/mobile/shared_nightspider_aggressor.iff"
result.attribute_template_id = 9
r... | 26.352941 | 67 | 0.732143 | true | true | |
1c3ee1adcd0fc78c7b46e0181a9583404d382497 | 570 | py | Python | analytics/migrations/0006_auto_20201019_1554.py | 12remember/qrl-analytics | 17d728225026354a9b2af3bd81cf11cef06279df | [
"MIT"
] | null | null | null | analytics/migrations/0006_auto_20201019_1554.py | 12remember/qrl-analytics | 17d728225026354a9b2af3bd81cf11cef06279df | [
"MIT"
] | 1 | 2022-03-03T21:55:24.000Z | 2022-03-03T21:55:24.000Z | analytics/migrations/0006_auto_20201019_1554.py | 12remember/quantascan-backend | 17d728225026354a9b2af3bd81cf11cef06279df | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-10-19 15:54
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('analytics', '0005_auto_20201019_1549'),
]
operations = [
migrations.RenameField(
model_name='qrlaggregatedtransactiondata',
... | 24.782609 | 59 | 0.622807 |
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('analytics', '0005_auto_20201019_1549'),
]
operations = [
migrations.RenameField(
model_name='qrlaggregatedtransactiondata',
old_name='type_of_transaction',
new... | true | true |
1c3ee1dfba8b2f8904b4d92a37b045666bf735f3 | 1,175 | py | Python | src/servo.py | macbury/pussificator | 1a8a3e0d029ec6f22161dfc41349f82b5df55a9f | [
"MIT"
] | 3 | 2019-01-09T09:54:25.000Z | 2019-06-30T07:10:01.000Z | src/servo.py | macbury/pussificator | 1a8a3e0d029ec6f22161dfc41349f82b5df55a9f | [
"MIT"
] | null | null | null | src/servo.py | macbury/pussificator | 1a8a3e0d029ec6f22161dfc41349f82b5df55a9f | [
"MIT"
] | null | null | null | import time
import json
from boot import CONFIG, LOGGER
from mqtt import MqttClient
import RPi.GPIO as GPIO
mqtt = MqttClient(CONFIG['mqtt'])
SERVO_PIN = 12
GPIO.setmode(GPIO.BOARD)
GPIO.setup(SERVO_PIN, GPIO.OUT)
pwm = GPIO.PWM(SERVO_PIN, 50)
pwm.start(0)
def turnOff():
GPIO.output(SERVO_PIN, False)
pwm.Chang... | 19.262295 | 64 | 0.700426 | import time
import json
from boot import CONFIG, LOGGER
from mqtt import MqttClient
import RPi.GPIO as GPIO
mqtt = MqttClient(CONFIG['mqtt'])
SERVO_PIN = 12
GPIO.setmode(GPIO.BOARD)
GPIO.setup(SERVO_PIN, GPIO.OUT)
pwm = GPIO.PWM(SERVO_PIN, 50)
pwm.start(0)
def turnOff():
GPIO.output(SERVO_PIN, False)
pwm.Chang... | true | true |
1c3ee281afe8d6eb06955116a1e1fc292afe6064 | 5,186 | py | Python | backend/main.py | waltercassiano/micropython-spa-react | 110fcd88c170251adad2b7e2e14dbdad94657370 | [
"MIT"
] | 6 | 2020-05-29T01:39:21.000Z | 2022-03-08T02:29:29.000Z | backend/main.py | waltercassiano/micropython-spa-react | 110fcd88c170251adad2b7e2e14dbdad94657370 | [
"MIT"
] | 2 | 2022-02-13T11:59:34.000Z | 2022-02-27T03:49:49.000Z | backend/main.py | waltercassiano/micropython-spa-react | 110fcd88c170251adad2b7e2e14dbdad94657370 | [
"MIT"
] | null | null | null | import network
import ure as re
import ubinascii
import uhashlib
from mimes import mime_content_type
import utils
if __name__ == "__main__":
picoweb = utils.import_or_install("picoweb", "picoweb")
logging = utils.import_or_install("micropython-ulogging", "ulogging")
from app_esp import config_service, user_ser... | 32.822785 | 122 | 0.66371 | import network
import ure as re
import ubinascii
import uhashlib
from mimes import mime_content_type
import utils
if __name__ == "__main__":
picoweb = utils.import_or_install("picoweb", "picoweb")
logging = utils.import_or_install("micropython-ulogging", "ulogging")
from app_esp import config_service, user_ser... | true | true |
1c3ee31a3897e2679ba3ab6df576be1484820e70 | 121 | py | Python | products/admin.py | anilchoudhary/ecommerce | f16a6e56ac1eb1050027c1f7c9a1d3e795dd3ffe | [
"MIT"
] | null | null | null | products/admin.py | anilchoudhary/ecommerce | f16a6e56ac1eb1050027c1f7c9a1d3e795dd3ffe | [
"MIT"
] | null | null | null | products/admin.py | anilchoudhary/ecommerce | f16a6e56ac1eb1050027c1f7c9a1d3e795dd3ffe | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Product
# Register your models here.
admin.site.register(Product)
| 17.285714 | 32 | 0.801653 | from django.contrib import admin
from .models import Product
admin.site.register(Product)
| true | true |
1c3ee34bf04c7cd14bd2cad070e9fb1c573743f3 | 4,115 | py | Python | drive.py | eagleanurag/End-to-End-Learning-for-Self-Driving-Cars | 0a32d90a6714515b6f0f0366b298b9c6d06119ab | [
"MIT"
] | null | null | null | drive.py | eagleanurag/End-to-End-Learning-for-Self-Driving-Cars | 0a32d90a6714515b6f0f0366b298b9c6d06119ab | [
"MIT"
] | null | null | null | drive.py | eagleanurag/End-to-End-Learning-for-Self-Driving-Cars | 0a32d90a6714515b6f0f0366b298b9c6d06119ab | [
"MIT"
] | 1 | 2018-11-05T05:11:02.000Z | 2018-11-05T05:11:02.000Z | import argparse
import base64
from io import BytesIO
import cv2
import eventlet.wsgi
import numpy as np
import socketio
from PIL import Image
from flask import Flask
from keras.models import model_from_json
# Fix error with Keras and TensorFlow
# tf.python.control_flow_ops = tf
sio = socketio.Server()
app = Flask(_... | 31.899225 | 143 | 0.652734 | import argparse
import base64
from io import BytesIO
import cv2
import eventlet.wsgi
import numpy as np
import socketio
from PIL import Image
from flask import Flask
from keras.models import model_from_json
sio = socketio.Server()
app = Flask(__name__)
model = None
prev_image_array = None
@sio.on('telemetry')
de... | true | true |
1c3ee39784619349a5434c775720649d03c9987e | 76,938 | py | Python | graph_objs/layout/polar/_angularaxis.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/layout/polar/_angularaxis.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | graph_objs/layout/polar/_angularaxis.py | wwwidonja/changed_plotly | 1bda35a438539a97c84a3ab3952e95e8848467bd | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class AngularAxis(_BaseLayoutHierarchyType):
# class properties
# --------------------
_parent_path_str = "layout.polar"
_path_str = "layout.polar.angularaxis"
_valid_props = {
"autot... | 36.918426 | 105 | 0.571044 | from plotly.basedatatypes import BaseLayoutHierarchyType as _BaseLayoutHierarchyType
import copy as _copy
class AngularAxis(_BaseLayoutHierarchyType):
_parent_path_str = "layout.polar"
_path_str = "layout.polar.angularaxis"
_valid_props = {
"autotypenumbers",
"categoryarray",
... | true | true |
1c3ee3ab8eb676d6083f1638cf4a2fa7730a9183 | 2,353 | py | Python | inception/inception/imagenet_distributed_train.py | robrkerr/tensorflow-models | 3656a07e89be134c2bc333c60a6c709e475024a6 | [
"Apache-2.0"
] | 308 | 2018-09-06T18:46:57.000Z | 2022-03-28T08:22:45.000Z | inception/inception/imagenet_distributed_train.py | robrkerr/tensorflow-models | 3656a07e89be134c2bc333c60a6c709e475024a6 | [
"Apache-2.0"
] | 64 | 2018-06-20T10:14:17.000Z | 2021-09-08T05:58:25.000Z | inception/inception/imagenet_distributed_train.py | robrkerr/tensorflow-models | 3656a07e89be134c2bc333c60a6c709e475024a6 | [
"Apache-2.0"
] | 69 | 2018-09-18T12:06:56.000Z | 2022-03-14T11:49:16.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 35.651515 | 80 | 0.700382 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from inception import inception_distributed_train
from inception.imagenet_data import ImagenetData
FLAGS = tf.app.flags.FLAGS
def main(unused_args):
assert FLAGS.job... | true | true |
1c3ee3f422b44ece53bc045044eb6ac24646c86c | 1,354 | py | Python | app.py | tamercuba/Hole-Checker | 4aac2c12023bd967a9a967d09145ce96c0f7fc27 | [
"MIT"
] | null | null | null | app.py | tamercuba/Hole-Checker | 4aac2c12023bd967a9a967d09145ce96c0f7fc27 | [
"MIT"
] | null | null | null | app.py | tamercuba/Hole-Checker | 4aac2c12023bd967a9a967d09145ce96c0f7fc27 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from unicodedata import normalize
import re
template = {
'A': 1, 'B': 2, 'C': 0, 'D': 1, 'E': 0, 'F': 0, 'G': 0, 'H': 0, 'I':0,
'J': 0, 'K': 0, 'L': 0, 'M': 0, 'N': 0, 'O': 1, 'P': 1, 'Q': 1, 'R': 1,
'S': 0, 'T': 0, 'U': 0, 'V': 0, 'X': 0, 'Z': 0, 'Y': 0, 'W': 0,
'a': 1, 'b': 1,... | 32.238095 | 76 | 0.488922 |
from unicodedata import normalize
import re
template = {
'A': 1, 'B': 2, 'C': 0, 'D': 1, 'E': 0, 'F': 0, 'G': 0, 'H': 0, 'I':0,
'J': 0, 'K': 0, 'L': 0, 'M': 0, 'N': 0, 'O': 1, 'P': 1, 'Q': 1, 'R': 1,
'S': 0, 'T': 0, 'U': 0, 'V': 0, 'X': 0, 'Z': 0, 'Y': 0, 'W': 0,
'a': 1, 'b': 1, 'c': 0, 'd': 1, 'e':... | true | true |
1c3ee498ef484f6bcd6ee5707607fd898847237d | 10,678 | py | Python | jorldy/core/agent/rnd_ppo.py | ramanuzan/JORLDY | be371ad0607e5dba5d5082101c38c6a9f2c96767 | [
"Apache-2.0"
] | null | null | null | jorldy/core/agent/rnd_ppo.py | ramanuzan/JORLDY | be371ad0607e5dba5d5082101c38c6a9f2c96767 | [
"Apache-2.0"
] | null | null | null | jorldy/core/agent/rnd_ppo.py | ramanuzan/JORLDY | be371ad0607e5dba5d5082101c38c6a9f2c96767 | [
"Apache-2.0"
] | null | null | null | import torch
torch.backends.cudnn.benchmark = True
import torch.nn.functional as F
from torch.distributions import Normal, Categorical
import os
import numpy as np
from .ppo import PPO
from core.network import Network
class RND_PPO(PPO):
"""Random Network Distillation (RND) with PPO agent.
Args:
st... | 35.712375 | 105 | 0.52847 | import torch
torch.backends.cudnn.benchmark = True
import torch.nn.functional as F
from torch.distributions import Normal, Categorical
import os
import numpy as np
from .ppo import PPO
from core.network import Network
class RND_PPO(PPO):
def __init__(
self,
state_size,
action_size,
... | true | true |
1c3ee539cc4950ecc94f13b442b74342ad083484 | 4,764 | py | Python | mfr/extensions/tabular/render.py | yacchin1205/RDM-modular-file-renderer | 5bd18175a681d21e7be7fe0238132335a1cd8ded | [
"Apache-2.0"
] | 36 | 2015-08-31T20:24:22.000Z | 2021-12-17T17:02:44.000Z | mfr/extensions/tabular/render.py | yacchin1205/RDM-modular-file-renderer | 5bd18175a681d21e7be7fe0238132335a1cd8ded | [
"Apache-2.0"
] | 190 | 2015-01-02T06:22:01.000Z | 2022-01-19T11:27:03.000Z | mfr/extensions/tabular/render.py | yacchin1205/RDM-modular-file-renderer | 5bd18175a681d21e7be7fe0238132335a1cd8ded | [
"Apache-2.0"
] | 47 | 2015-01-27T15:45:22.000Z | 2021-01-27T22:43:03.000Z | import json
import gc
import logging
import os
from humanfriendly import format_size
from mako.lookup import TemplateLookup
from mfr.core import extension
from mfr.extensions.tabular import settings, exceptions
logger = logging.getLogger(__name__)
class TabularRenderer(extension.BaseRenderer):
TEMPLATE = Temp... | 34.521739 | 99 | 0.594039 | import json
import gc
import logging
import os
from humanfriendly import format_size
from mako.lookup import TemplateLookup
from mfr.core import extension
from mfr.extensions.tabular import settings, exceptions
logger = logging.getLogger(__name__)
class TabularRenderer(extension.BaseRenderer):
TEMPLATE = Temp... | true | true |
1c3ee66be7cb539f9dc17ecf8d3f1a6c60a4dcfc | 690 | py | Python | Jimmy66/0015/0015.py | hooting/show-me-the-code-python | 0026ee495eade7c28aa5a1249716b1fdc20a141c | [
"MIT"
] | null | null | null | Jimmy66/0015/0015.py | hooting/show-me-the-code-python | 0026ee495eade7c28aa5a1249716b1fdc20a141c | [
"MIT"
] | null | null | null | Jimmy66/0015/0015.py | hooting/show-me-the-code-python | 0026ee495eade7c28aa5a1249716b1fdc20a141c | [
"MIT"
] | 1 | 2021-08-29T10:10:30.000Z | 2021-08-29T10:10:30.000Z | #!/bin/env python
# -*- coding: utf-8 -*-
#导入模块
import simplejson as json
import xlwt
#从文件(JSON形式)中读取数据返回字典
def read_file(filename):
with open(filename,'r') as fp:
content = fp.read()
d = json.JSONDecoder().decode(content)
return d
#生成对应的xls文件
def gen_xls(d,filename):
fp = xlwt.Workbook(... | 19.714286 | 55 | 0.615942 |
import simplejson as json
import xlwt
def read_file(filename):
with open(filename,'r') as fp:
content = fp.read()
d = json.JSONDecoder().decode(content)
return d
def gen_xls(d,filename):
fp = xlwt.Workbook()
table = fp.add_sheet('city',cell_overwrite_ok=True)
for n in ra... | false | true |
1c3ee72bbc28c79942db067dc586c55460ee4caf | 2,589 | py | Python | tools/mo/unit_tests/mo/front/onnx/activation_ext_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/unit_tests/mo/front/onnx/activation_ext_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/unit_tests/mo/front/onnx/activation_ext_test.py | ryanloney/openvino-1 | 4e0a740eb3ee31062ba0df88fcf438564f67edb7 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
import onnx
from generator import generator, generate
import openvino.tools.mo.front.onnx.activation_ext as extractors
from openvino.tools.mo.ops.activation_ops import Elu
from openvino.tools.mo.graph... | 29.420455 | 143 | 0.591348 |
import unittest
import numpy as np
import onnx
from generator import generator, generate
import openvino.tools.mo.front.onnx.activation_ext as extractors
from openvino.tools.mo.ops.activation_ops import Elu
from openvino.tools.mo.graph.graph import Node
from openvino.tools.mo.ops.op import Op
from unit_tests.utils... | true | true |
1c3ee7b266d51215d446e12b11014bfad3376df9 | 1,438 | py | Python | docs/conf.py | qlixed/pymemwiper | 216bc05f9b67e37d0c98e3f3a70f08e3362f07d9 | [
"MIT"
] | 2 | 2017-12-08T22:52:20.000Z | 2018-10-28T20:40:42.000Z | docs/conf.py | qlixed/pymemwiper | 216bc05f9b67e37d0c98e3f3a70f08e3362f07d9 | [
"MIT"
] | 20 | 2017-06-04T22:13:06.000Z | 2020-01-05T22:32:24.000Z | docs/conf.py | qlixed/python-memwiper | 216bc05f9b67e37d0c98e3f3a70f08e3362f07d9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext... | 26.145455 | 74 | 0.698192 |
from __future__ import unicode_literals
import os
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.coverage',
'sphinx.ext.doctest',
'sphinx.ext.extlinks',
'sphinx.ext.ifconfig',
'sphinx.ext.napoleon',
'sphinx.ext.todo',
'sphinx.ext.viewcode',
]
if os.get... | true | true |
1c3ee841d66b0cc7cfd54b1431b94a4ac454cbf5 | 1,596 | py | Python | aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/DeleteTagSetRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | 1 | 2019-12-23T12:36:43.000Z | 2019-12-23T12:36:43.000Z | aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/DeleteTagSetRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-imm/aliyunsdkimm/request/v20170906/DeleteTagSetRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | 1 | 2021-02-23T11:27:54.000Z | 2021-02-23T11:27:54.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.25 | 71 | 0.754386 |
from aliyunsdkcore.request import RpcRequest
class DeleteTagSetRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'imm', '2017-09-06', 'DeleteTagSet','imm')
def get_LazyMode(self):
return self.get_query_params().get('LazyMode')
def set_LazyMode(self,LazyMode):
self.a... | true | true |
1c3eea5aece6d683e89d4098eb1688877e50e47b | 1,110 | py | Python | tscore-test.py | newsgac/fasttext-runs | 50cc6bf4d8441f7208efb6b71eb45e7641d1af09 | [
"Apache-2.0"
] | null | null | null | tscore-test.py | newsgac/fasttext-runs | 50cc6bf4d8441f7208efb6b71eb45e7641d1af09 | [
"Apache-2.0"
] | null | null | null | tscore-test.py | newsgac/fasttext-runs | 50cc6bf4d8441f7208efb6b71eb45e7641d1af09 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3 -W all
"""
tscore-test.py: tests for tscore.py
usage: tscore-test.py
20171124 erikt(at)xs4all.nl
"""
import io
import re
import sys
import unittest
from contextlib import redirect_stdout
from tscore import computeTscore
from tscore import readData
from tscore import tscore
from tscore im... | 25.813953 | 71 | 0.67027 |
import io
import re
import sys
import unittest
from contextlib import redirect_stdout
from tscore import computeTscore
from tscore import readData
from tscore import tscore
from tscore import writeData
DATA1 = { "totalFreq":3, "nbrOfWords":2, "wordFreqs":{"a":1, "b":2 } }
DATA2 = { "totalFreq":3, "nbrOfWords":2, "wo... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.