hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0c210b401dff1c03dcf7b53c0c41991703d00c8a | 17,609 | py | Python | lib/pavilion/schedulers.py | lanl-preteam/pavilion2-tmp | fd846b0508e2a3d60d4f2f538aa8fb5ff2ae9c8f | [
"BSD-3-Clause"
] | 1 | 2019-08-30T14:34:52.000Z | 2019-08-30T14:34:52.000Z | lib/pavilion/schedulers.py | lanl-preteam/pavilion2-tmp | fd846b0508e2a3d60d4f2f538aa8fb5ff2ae9c8f | [
"BSD-3-Clause"
] | null | null | null | lib/pavilion/schedulers.py | lanl-preteam/pavilion2-tmp | fd846b0508e2a3d60d4f2f538aa8fb5ff2ae9c8f | [
"BSD-3-Clause"
] | null | null | null | # pylint: disable=no-self-use
import datetime
import inspect
import logging
import os
import subprocess
from functools import wraps
from pathlib import Path
import tzlocal
from pavilion import scriptcomposer
from pavilion.lockfile import LockFile
from pavilion.status_file import STATES, StatusInfo
from pavilion.test_... | 32.914019 | 79 | 0.628372 |
d310857f16fedfa7a77eb833877ebde2d8ffe90b | 5,261 | py | Python | docs/source/conf.py | grispan56/CyberCure.ai-Python-sdk | 726db1a1db8e29a312bfdc8ab5bfd42a93c557a0 | [
"MIT"
] | 2 | 2018-08-09T06:14:32.000Z | 2020-02-13T10:01:48.000Z | docs/source/conf.py | grispan56/CyberCure.ai-Python-sdk | 726db1a1db8e29a312bfdc8ab5bfd42a93c557a0 | [
"MIT"
] | null | null | null | docs/source/conf.py | grispan56/CyberCure.ai-Python-sdk | 726db1a1db8e29a312bfdc8ab5bfd42a93c557a0 | [
"MIT"
] | 1 | 2020-10-26T21:56:29.000Z | 2020-10-26T21:56:29.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.947059 | 101 | 0.662612 |
527b485a9e06384c022b010d81af46280c444963 | 2,470 | py | Python | rqalpha/utils/logger.py | doccccu/rqalpha | 4356e31be2cf4c787ec8e742b2f2c7fda7f741d2 | [
"Apache-2.0"
] | 2 | 2017-05-06T23:59:14.000Z | 2022-02-06T05:58:12.000Z | rqalpha/utils/logger.py | cjhfly/rqalpha | 4356e31be2cf4c787ec8e742b2f2c7fda7f741d2 | [
"Apache-2.0"
] | null | null | null | rqalpha/utils/logger.py | cjhfly/rqalpha | 4356e31be2cf4c787ec8e742b2f2c7fda7f741d2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 24.215686 | 77 | 0.701215 |
eaed7a9f9ff6236f46fd3ef1f459f15d42ab1794 | 7,076 | py | Python | Lib/encodings/cp865.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 5 | 2022-03-26T21:53:36.000Z | 2022-03-30T21:47:20.000Z | Lib/encodings/cp865.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 6 | 2020-11-18T15:48:14.000Z | 2021-05-03T21:20:50.000Z | Lib/encodings/cp865.py | marcosptf/cpython-2.0.1 | 73c739a764e8b1dc84640e73b880bc66e1916bca | [
"PSF-2.0"
] | 2 | 2015-07-16T08:14:13.000Z | 2022-03-27T01:55:17.000Z | """ Python Character Mapping Codec generated from 'CP865.TXT'.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(in... | 40.434286 | 69 | 0.749717 |
6f4dbf0aa254e63b9c2d71179ade91935afc6707 | 1,369 | py | Python | setup.py | newearthmartin/escapejson | c9823d01ca9d6fa9cb665bacd51156f0f39435c6 | [
"BSD-2-Clause"
] | null | null | null | setup.py | newearthmartin/escapejson | c9823d01ca9d6fa9cb665bacd51156f0f39435c6 | [
"BSD-2-Clause"
] | null | null | null | setup.py | newearthmartin/escapejson | c9823d01ca9d6fa9cb665bacd51156f0f39435c6 | [
"BSD-2-Clause"
] | null | null | null | import os
from setuptools import find_packages, setup
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme:
README = readme.read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='escapejson',
versio... | 37 | 123 | 0.649379 |
5bcc61b45832bd19c576ed2f23ce791e376e247f | 27,861 | py | Python | myems-api/excelexporters/spaceoutput.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 82 | 2021-02-19T10:24:31.000Z | 2022-03-28T06:30:18.000Z | myems-api/excelexporters/spaceoutput.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 188 | 2021-02-22T07:08:30.000Z | 2022-03-02T04:11:03.000Z | myems-api/excelexporters/spaceoutput.py | guangyuzhang/myems | c88f0620d3e36154a500c755c805333b771d09c0 | [
"MIT"
] | 54 | 2021-02-19T08:48:46.000Z | 2022-03-30T06:21:34.000Z | import base64
import uuid
import os
import re
from openpyxl.chart import PieChart, LineChart, Reference
from openpyxl.styles import PatternFill, Border, Side, Alignment, Font
from openpyxl.drawing.image import Image
from openpyxl import Workbook
from openpyxl.chart.label import DataLabelList
import openpyxl.utils.cell ... | 41.275556 | 120 | 0.561897 |
17eb58b3cf2284ba7a02474f034c39d79e21dccd | 871 | py | Python | python/oneflow/compatible/single_client/deprecated/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/deprecated/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/deprecated/__init__.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 33.5 | 74 | 0.797933 |
a1fe7ce94d40e8732f63bc72f7f845273e615ebe | 1,044 | py | Python | generate.py | paulwuertz/hellapagos_galerapagos | c77eb02eea6cf0a023cdb0cbc62efdbd1e738df2 | [
"MIT"
] | null | null | null | generate.py | paulwuertz/hellapagos_galerapagos | c77eb02eea6cf0a023cdb0cbc62efdbd1e738df2 | [
"MIT"
] | 1 | 2019-08-03T00:37:58.000Z | 2019-08-03T07:41:10.000Z | generate.py | paulwuertz/hellapagos_galerapagos | c77eb02eea6cf0a023cdb0cbc62efdbd1e738df2 | [
"MIT"
] | 2 | 2019-08-02T09:26:04.000Z | 2019-08-08T15:38:55.000Z | import jinja2, yaml, os
import subprocess, textwrap
kartoj = yaml.safe_load(open("kartoj.yaml").read()) # listo de kartoj
for k in kartoj: #trancxu tekston al sammlongaj lineoj
k["titolo"] = textwrap.wrap(k["titolo"], 13)
k["svg"] = k["svg"] if os.path.isfile(k["svg"]) else "akvobotelo.svg"
kartoj = [k for ... | 52.2 | 123 | 0.650383 |
832bfb7a58a1bf445d19f108f19e504d330d0d4b | 29 | py | Python | ABC_A/ABC140_A.py | ryosuke0825/atcoder_python | 185cdbe7db44ecca1aaf357858d16d31ce515ddb | [
"MIT"
] | null | null | null | ABC_A/ABC140_A.py | ryosuke0825/atcoder_python | 185cdbe7db44ecca1aaf357858d16d31ce515ddb | [
"MIT"
] | null | null | null | ABC_A/ABC140_A.py | ryosuke0825/atcoder_python | 185cdbe7db44ecca1aaf357858d16d31ce515ddb | [
"MIT"
] | null | null | null | n = int(input())
print(n**3)
| 9.666667 | 16 | 0.551724 |
f2eca8fbdb7b3711dc8bf8d6723f5ccb29615bac | 920 | py | Python | authors/apps/comments/urls.py | andela/Ah-backend-guardians | cc84c18f7c222bc69cf4a263a1c2296b6d335c8b | [
"BSD-3-Clause"
] | null | null | null | authors/apps/comments/urls.py | andela/Ah-backend-guardians | cc84c18f7c222bc69cf4a263a1c2296b6d335c8b | [
"BSD-3-Clause"
] | 32 | 2019-01-09T07:52:32.000Z | 2022-01-13T01:01:55.000Z | authors/apps/comments/urls.py | andela/Ah-backend-guardians | cc84c18f7c222bc69cf4a263a1c2296b6d335c8b | [
"BSD-3-Clause"
] | 3 | 2019-01-03T12:05:53.000Z | 2019-09-24T11:41:14.000Z | from django.urls import path
from .views import (CreateCommentAPiView, CommentApiView,
CommentThreadApiView, LikeCommentApiView,
GetCommentApiView, CommentHistoryListView)
urlpatterns = [
path('<slug>/comments/',
CreateCommentAPiView.as_view(),
name='comme... | 32.857143 | 62 | 0.613043 |
b7b23bf076b6c029e582dd82c13fd53d4978847e | 394 | py | Python | indices/migrations/0004_auto_20160423_0855.py | garyelephant/elasticmanager | 613744f3dbbfb032470b98d912ff0ae36bdac8a8 | [
"MIT"
] | 18 | 2016-05-27T12:30:13.000Z | 2021-01-05T11:05:02.000Z | indices/migrations/0004_auto_20160423_0855.py | garyelephant/elasticmanager | 613744f3dbbfb032470b98d912ff0ae36bdac8a8 | [
"MIT"
] | null | null | null | indices/migrations/0004_auto_20160423_0855.py | garyelephant/elasticmanager | 613744f3dbbfb032470b98d912ff0ae36bdac8a8 | [
"MIT"
] | 2 | 2016-05-06T06:10:30.000Z | 2020-03-28T03:38:23.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('indices', '0003_auto_20160423_0552'),
]
operations = [
migrations.RenameField(
model_name='taskexec',
... | 19.7 | 47 | 0.601523 |
6264ae5d7161d1cd8fb1af9c36377ee49e8bf08b | 737 | py | Python | backend/driver/api/v1/viewsets.py | crowdbotics-apps/rizen-electronics-28731 | 1edb5659f406ac440d8bb8d3925317578a048cd8 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/driver/api/v1/viewsets.py | crowdbotics-apps/rizen-electronics-28731 | 1edb5659f406ac440d8bb8d3925317578a048cd8 | [
"FTL",
"AML",
"RSA-MD"
] | 6 | 2021-09-05T20:16:37.000Z | 2021-10-04T20:42:57.000Z | backend/driver/api/v1/viewsets.py | crowdbotics-apps/natures-cornucopia-30308 | 847053dad41bda7122bc15710e0e9e2bf89d6882 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from rest_framework import authentication
from driver.models import DriverProfile, DriverOrder
from .serializers import DriverProfileSerializer, DriverOrderSerializer
from rest_framework import viewsets
class DriverProfileViewSet(viewsets.ModelViewSet):
serializer_class = DriverProfileSerializer
authenticatio... | 32.043478 | 71 | 0.793758 |
201f8328394a7dfe18eab305b16819b51b08c319 | 5,597 | py | Python | softwares/hisat2-2.1.0/hisat2_extract_exons.py | nishill/ContainerInception | 1fc001733d7ef637ac290f61696bbdced434927c | [
"MIT"
] | 6 | 2018-04-01T21:49:51.000Z | 2020-01-04T04:31:02.000Z | softwares/hisat2-2.1.0/hisat2_extract_exons.py | nishill/ContainerInception | 1fc001733d7ef637ac290f61696bbdced434927c | [
"MIT"
] | 2 | 2017-11-29T17:20:26.000Z | 2017-11-29T17:44:24.000Z | bin/Linux.x86_64/hisat2_extract_exons.py | hmgene/APAchi | 4fb56886c5074f022573db1e7f4fecfd17bf9ccb | [
"Apache-2.0"
] | 7 | 2018-04-02T17:13:07.000Z | 2018-04-04T01:11:50.000Z | #!/usr/bin/env python
#
# Copyright 2015, Daehwan Kim <infphilo@gmail.com>
#
# This file is part of HISAT 2.
#
# HISAT 2 is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (... | 34.549383 | 77 | 0.565124 |
b2667e192787c516eabfc00af61e8f8fd74964bf | 5,139 | py | Python | src/py/flwr/server/grpc_server/grpc_bridge_test.py | Chris-george-anil/flower | 98fb2fcde273c1226cc1f2e1638c1e4d8f35815c | [
"Apache-2.0"
] | 895 | 2020-03-22T20:34:16.000Z | 2022-03-31T15:20:42.000Z | src/py/flwr/server/grpc_server/grpc_bridge_test.py | Chris-george-anil/flower | 98fb2fcde273c1226cc1f2e1638c1e4d8f35815c | [
"Apache-2.0"
] | 322 | 2020-02-19T10:16:33.000Z | 2022-03-31T09:49:08.000Z | src/py/flwr/server/grpc_server/grpc_bridge_test.py | Chris-george-anil/flower | 98fb2fcde273c1226cc1f2e1638c1e4d8f35815c | [
"Apache-2.0"
] | 234 | 2020-03-31T10:52:16.000Z | 2022-03-31T14:04:42.000Z | # Copyright 2020 Adap GmbH. 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 ag... | 30.408284 | 81 | 0.65538 |
e619b39f2a68f43921eda687a0d924b885f7458b | 43,446 | py | Python | weasyprint/draw.py | nschlemm/WeasyPrint | 9f6edeed1bf30d15fda4f018717dfb3eb9ae40fe | [
"BSD-3-Clause"
] | null | null | null | weasyprint/draw.py | nschlemm/WeasyPrint | 9f6edeed1bf30d15fda4f018717dfb3eb9ae40fe | [
"BSD-3-Clause"
] | null | null | null | weasyprint/draw.py | nschlemm/WeasyPrint | 9f6edeed1bf30d15fda4f018717dfb3eb9ae40fe | [
"BSD-3-Clause"
] | null | null | null | """
weasyprint.draw
---------------
Take an "after layout" box tree and draw it onto a cairo context.
"""
import contextlib
import operator
from math import ceil, floor, hypot, pi, sqrt, tan
import cairocffi as cairo
from .formatting_structure import boxes
from .images import SVGImage
from .layout impo... | 38.515957 | 79 | 0.55989 |
f3099ab8405eee41c222aa2bad55c575112767a4 | 1,273 | py | Python | data/p4VQE/R4/benchmark/startPyquil815.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil815.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startPyquil815.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=14
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(1) # number=2
pr... | 23.574074 | 64 | 0.600943 |
884a147d7509ff4fdfac7a24aac70b3ba9115125 | 24,167 | py | Python | pandas/tests/frame/test_alter_axes.py | alorenzo175/pandas | 70f79ce5fb4355b545df4a5cc01ca32d93be085a | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/tests/frame/test_alter_axes.py | alorenzo175/pandas | 70f79ce5fb4355b545df4a5cc01ca32d93be085a | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/tests/frame/test_alter_axes.py | alorenzo175/pandas | 70f79ce5fb4355b545df4a5cc01ca32d93be085a | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import print_function
from datetime import datetime, timedelta
import numpy as np
from pandas.compat import lrange
from pandas import DataFrame, Series, Index, MultiIndex, RangeIndex
import pandas as pd
from pandas.util.testing import (assert_almost_equal,
... | 38.238924 | 79 | 0.514255 |
77756e0c6bef7ff95d2e414f681218d1f63d1963 | 56,132 | py | Python | core/storage/statistics/gae_models_test.py | JeeveshGarg/oppia | 8d4efdb2b1521eb6432ddc12e7bed55c8e90db06 | [
"Apache-2.0"
] | 1 | 2021-12-17T15:21:23.000Z | 2021-12-17T15:21:23.000Z | core/storage/statistics/gae_models_test.py | JeeveshGarg/oppia | 8d4efdb2b1521eb6432ddc12e7bed55c8e90db06 | [
"Apache-2.0"
] | null | null | null | core/storage/statistics/gae_models_test.py | JeeveshGarg/oppia | 8d4efdb2b1521eb6432ddc12e7bed55c8e90db06 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2017 The Oppia 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 requi... | 44.977564 | 143 | 0.693811 |
b4d4d1a9832e3e39208e0aacf3e2424a1378aee4 | 3,294 | py | Python | ml3d/tf/utils/helper_tf.py | MSaeedMp/Open3D-ML | 5e6a007bbe8423291b8c4c760688975c95d2d5c1 | [
"MIT"
] | 346 | 2021-07-27T20:14:47.000Z | 2022-03-31T12:19:39.000Z | ml3d/tf/utils/helper_tf.py | MSaeedMp/Open3D-ML | 5e6a007bbe8423291b8c4c760688975c95d2d5c1 | [
"MIT"
] | 179 | 2021-07-27T15:32:33.000Z | 2022-03-30T14:32:53.000Z | ml3d/tf/utils/helper_tf.py | MSaeedMp/Open3D-ML | 5e6a007bbe8423291b8c4c760688975c95d2d5c1 | [
"MIT"
] | 92 | 2021-07-28T13:50:52.000Z | 2022-03-30T09:24:33.000Z | """Wrapper functions for TensorFlow layers."""
import tensorflow as tf
class ExpandDims(tf.keras.layers.Layer):
def __init__(self, axis=-1):
super(ExpandDims, self).__init__()
self.axis = axis
def build(self, input_shape):
pass
def call(self, input):
return tf.expand_di... | 28.643478 | 77 | 0.554948 |
e52e5f40a0841eb58257e75fc5a77a8b78c5cb9e | 920 | py | Python | src/lib/libfuturize/fixes/fix_execfile.py | thonkify/thonkify | 2cb4493d796746cb46c8519a100ef3ef128a761a | [
"MIT"
] | 17 | 2017-08-04T15:41:05.000Z | 2020-10-16T18:02:41.000Z | src/lib/libfuturize/fixes/fix_execfile.py | thonkify/thonkify | 2cb4493d796746cb46c8519a100ef3ef128a761a | [
"MIT"
] | 3 | 2017-08-04T23:37:37.000Z | 2017-08-04T23:38:34.000Z | src/lib/libfuturize/fixes/fix_execfile.py | thonkify/thonkify | 2cb4493d796746cb46c8519a100ef3ef128a761a | [
"MIT"
] | 3 | 2017-12-07T16:30:59.000Z | 2019-06-16T02:48:28.000Z | # coding: utf-8
"""
Fixer for the execfile() function on Py2, which was removed in Py3.
The Lib/lib2to3/fixes/fix_execfile.py module has some problems: see
python-future issue #37. This fixer merely imports execfile() from
past.builtins and leaves the code alone.
Adds this import line::
from past.builtins import... | 24.864865 | 67 | 0.675 |
bafb300d14729009990d80ddbe178f6476d60c14 | 1,228 | py | Python | nightcapcli/setup.py | abaker2010/NightCAP | c58365a0e2ff1896ce0f8fbf2977b3e83feee1e2 | [
"MIT"
] | 2 | 2022-02-11T17:47:38.000Z | 2022-02-11T21:13:36.000Z | nightcapcli/setup.py | abaker2010/NightCAP | c58365a0e2ff1896ce0f8fbf2977b3e83feee1e2 | [
"MIT"
] | null | null | null | nightcapcli/setup.py | abaker2010/NightCAP | c58365a0e2ff1896ce0f8fbf2977b3e83feee1e2 | [
"MIT"
] | null | null | null | from __future__ import with_statement
import os
import re
import setuptools
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
NAME = "nightcapcli"
def read_file(path) -> str:
with open(os.path.join(os.path.dirname(__file__), path)) as fp:
return fp.read()
... | 23.169811 | 68 | 0.67101 |
a289122a8d3d3276d4e6b38bc1ea2cf444e8e21b | 367 | py | Python | locations_jp/api.py | hdknr/django-locations_jp | 84c43e2bc90693158e1a5580cc3dfa206b340ddc | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | locations_jp/api.py | hdknr/django-locations_jp | 84c43e2bc90693158e1a5580cc3dfa206b340ddc | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | locations_jp/api.py | hdknr/django-locations_jp | 84c43e2bc90693158e1a5580cc3dfa206b340ddc | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | from django.conf.urls import url, include
from rest_framework.routers import DefaultRouter
from . import views, viewsets
router = DefaultRouter()
router.register(r'jpaddress', viewsets.JpAddressViewSet, base_name='jpaddress')
router.register(r'prefecture', viewsets.PrefectureViewSet, base_name='prefecture')
urlpatte... | 28.230769 | 82 | 0.782016 |
21bf035acf25fd6d68524062980fe3fddadee460 | 6,868 | py | Python | test.py | MichiganCOG/Video-Grounding | 3e0ec0b69578a59be583911590354fe77d357cab | [
"MIT"
] | 41 | 2018-09-05T14:52:01.000Z | 2022-03-27T19:08:56.000Z | test.py | MichiganCOG/Video-Grounding | 3e0ec0b69578a59be583911590354fe77d357cab | [
"MIT"
] | 6 | 2019-04-16T05:59:27.000Z | 2019-07-11T14:14:46.000Z | test.py | MichiganCOG/Video-Grounding | 3e0ec0b69578a59be583911590354fe77d357cab | [
"MIT"
] | 7 | 2019-11-19T05:54:08.000Z | 2022-02-18T22:04:32.000Z |
# general packages
import argparse
import numpy as np
import random
import os
import errno
import time
import math
from collections import defaultdict
import json
# torch
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import torch.optim as optim
from torch.optim import lr_scheduler
f... | 37.124324 | 163 | 0.700932 |
ed99b40403fb93c27fb0fac8ed167396d3360691 | 3,084 | py | Python | core/src/test/bootstrap/automated/util.py | MayerRoman/Lagerta | 71091459c4afdae189149f033a98b5975d55dcd3 | [
"Apache-2.0"
] | 4 | 2017-07-12T12:18:03.000Z | 2021-04-01T16:07:06.000Z | core/src/test/bootstrap/automated/util.py | MayerRoman/Lagerta | 71091459c4afdae189149f033a98b5975d55dcd3 | [
"Apache-2.0"
] | 3 | 2017-06-22T10:27:02.000Z | 2017-06-27T07:47:00.000Z | core/src/test/bootstrap/automated/util.py | MayerRoman/Lagerta | 71091459c4afdae189149f033a98b5975d55dcd3 | [
"Apache-2.0"
] | 6 | 2017-06-22T10:06:57.000Z | 2019-09-02T04:49:35.000Z | #
# Copyright (c) 2017. EPAM Systems
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 32.125 | 87 | 0.693904 |
662dd445b2489d544e920003a3d0343e44b7b45f | 5,565 | py | Python | python/lbann/core/layer.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | python/lbann/core/layer.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | python/lbann/core/layer.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | """Neural network tensor operations."""
import abc
from lbann import layers_pb2
from lbann.util import make_iterable
import lbann.core.util
class Layer(abc.ABC):
"""Neural network tensor operation.
Args:
*args (Layer): Parent layers, i.e. sources of input tensors.
parents (Iterable of Layer, o... | 34.78125 | 93 | 0.603774 |
3c70b368a942eae953fa745209cea3058bc14793 | 9,277 | py | Python | parsers/pyBSRP/build/lib/bsrp/BSRParser.py | uky-transport-data-science/BSR_parsers | 2d3a34b76481b94c74df8ab406340eb62aac28ab | [
"Apache-2.0"
] | 4 | 2019-12-27T13:33:33.000Z | 2022-01-20T14:08:22.000Z | parsers/pyBSRP/build/lib/bsrp/BSRParser.py | uky-transport-data-science/BSR_parsers | 2d3a34b76481b94c74df8ab406340eb62aac28ab | [
"Apache-2.0"
] | null | null | null | parsers/pyBSRP/build/lib/bsrp/BSRParser.py | uky-transport-data-science/BSR_parsers | 2d3a34b76481b94c74df8ab406340eb62aac28ab | [
"Apache-2.0"
] | 1 | 2021-03-16T16:20:40.000Z | 2021-03-16T16:20:40.000Z | import os, imp, requests, json, imp, sys
from datetime import datetime
from bsrp import bsrputil
class BSRParser(object):
""" Class for the retrieving data from BSS data feeds.
Input required is the BSR data feed object
Additional parameters can specify output, (array or string) or save (raw and cleaned) p... | 38.493776 | 185 | 0.559879 |
5ca439bac604660d60d7970dad8ec319ffbf5cbf | 8,816 | py | Python | recoapis/amazonrecoapi/amazonrecoapi.py | Crossing-Minds/reco-api-benchmarks | f740072a23e88270632a1acda468854e457d5086 | [
"MIT"
] | 3 | 2021-07-21T04:56:10.000Z | 2022-01-24T21:14:45.000Z | recoapis/amazonrecoapi/amazonrecoapi.py | Crossing-Minds/reco-api-benchmarks | f740072a23e88270632a1acda468854e457d5086 | [
"MIT"
] | null | null | null | recoapis/amazonrecoapi/amazonrecoapi.py | Crossing-Minds/reco-api-benchmarks | f740072a23e88270632a1acda468854e457d5086 | [
"MIT"
] | 1 | 2021-07-21T04:56:11.000Z | 2021-07-21T04:56:11.000Z | import time
import numpy
from tqdm import tqdm
from botocore.exceptions import ClientError
from xminds.compat import logger
from xminds.lib.utils import deep_hash, retry
from ..baserecoapi import BaseRecoApi
from .clients import AmazonApiClients
from .reset_resources import aws_reset
from .upload import aws_prepare_r... | 46.893617 | 153 | 0.652677 |
b91a08f9675a50655a75f0c13fd1bc4e87a7797d | 6,818 | py | Python | Scripts/lib_name_standardizations.py | Alex-zh95/insurance-mathematics | 284645e5a4ef9f0beb914b343bff1f8561a2cb98 | [
"MIT"
] | null | null | null | Scripts/lib_name_standardizations.py | Alex-zh95/insurance-mathematics | 284645e5a4ef9f0beb914b343bff1f8561a2cb98 | [
"MIT"
] | null | null | null | Scripts/lib_name_standardizations.py | Alex-zh95/insurance-mathematics | 284645e5a4ef9f0beb914b343bff1f8561a2cb98 | [
"MIT"
] | null | null | null | # %% [markdown]
# # Name standardization
#
# One of the major problems in any data-handling situation is the need to match up databases based on names as indices may either not be available or different databases on different systems use incompatible identifiers. An example for insurance is the matching of company nam... | 40.583333 | 527 | 0.672338 |
2029fc1c3ac2b14eccf941471ba530f5676067a2 | 3,736 | py | Python | segmentator/future/wip_arcweld_mp2rage.py | klezm/segmentator | b1c8f986aa2404806223e5034ae43b14b90cd5ed | [
"BSD-3-Clause"
] | 62 | 2016-06-08T07:32:55.000Z | 2022-02-28T02:03:03.000Z | segmentator/future/wip_arcweld_mp2rage.py | klezm/segmentator | b1c8f986aa2404806223e5034ae43b14b90cd5ed | [
"BSD-3-Clause"
] | 79 | 2016-07-25T12:16:31.000Z | 2021-02-16T06:45:34.000Z | segmentator/future/wip_arcweld_mp2rage.py | klezm/segmentator | b1c8f986aa2404806223e5034ae43b14b90cd5ed | [
"BSD-3-Clause"
] | 16 | 2017-01-12T11:50:00.000Z | 2022-02-07T19:17:51.000Z | """Full automation experiments for T1w-like data (MPRAGE & MP2RAGE).
TODO:
- Put anisotropic diffusion based smoothing to segmentator utilities.
- MP2RAGE, 2 type of gray matter giving issues, barycentric weights might
be useful to deal with this issue.
"""
import os
import peakutils
import numpy as np
i... | 31.133333 | 91 | 0.696199 |
542d091cd9d5dbc4a766771580b4d03080681d33 | 1,306 | py | Python | azure-mgmt-iothub/azure/mgmt/iothub/models/routing_message.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-iothub/azure/mgmt/iothub/models/routing_message.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-iothub/azure/mgmt/iothub/models/routing_message.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 35.297297 | 76 | 0.595712 |
3ddf47a119839a2ecc66f1aa6c03c7a4d9d991fb | 46,212 | py | Python | python/tvm/relay/frontend/mxnet.py | peterjc123/tvm | d6dcd6c56febfbb12efe67884c188f045f435893 | [
"Apache-2.0"
] | 48 | 2020-07-29T18:09:23.000Z | 2021-10-09T01:53:33.000Z | python/tvm/relay/frontend/mxnet.py | peterjc123/tvm | d6dcd6c56febfbb12efe67884c188f045f435893 | [
"Apache-2.0"
] | 9 | 2021-04-02T02:28:07.000Z | 2022-03-26T18:23:59.000Z | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/relay/frontend/mxnet.py | lablup/training_results_v0.7 | f5bb59aa0f8b18b602763abe47d1d24d0d54b197 | [
"Apache-2.0"
] | 42 | 2020-08-01T06:41:24.000Z | 2022-01-20T10:33:08.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.350207 | 99 | 0.622847 |
a8dd2ea87ba2992f9564ab8caeb69f0cef1132b7 | 4,162 | py | Python | test/test_npu/test_network_ops/test_gru_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-12-02T03:07:35.000Z | 2021-12-02T03:07:35.000Z | test/test_npu/test_network_ops/test_gru_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | 1 | 2021-11-12T07:23:03.000Z | 2021-11-12T08:28:13.000Z | test/test_npu/test_network_ops/test_gru_backward.py | Ascend/pytorch | 39849cf72dafe8d2fb68bd1679d8fd54ad60fcfc | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020 Huawei Technologies Co., Ltd
# Copyright (c) 2019, Facebook CORPORATION.
# All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://opensource.org/lice... | 48.964706 | 131 | 0.653532 |
e24bc4eb6c4172b783608cd6d2e63bb65c2afcfb | 1,443 | py | Python | examples/docs_snippets/docs_snippets/concepts/io_management/subselection.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/io_management/subselection.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/io_management/subselection.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=unused-argument
from dagster import IOManager, In, Out, io_manager, job, op, root_input_manager
def write_dataframe_to_table(**_kwargs):
pass
def read_dataframe_from_table(**_kwargs):
pass
# start_marker
@root_input_manager(input_config_schema={"table_name": str})
def my_root_input_manag... | 20.614286 | 79 | 0.695773 |
7d3b3de6538d298b5f0c429760bfaf8e62ba516b | 8,914 | bzl | Python | bazel/envoy_mobile_repositories.bzl | lyft/envoy-mobile | 218e317288f79915249e7bee33a4c8ec58cfd76d | [
"Apache-2.0"
] | 399 | 2019-06-17T23:05:09.000Z | 2020-11-11T09:15:47.000Z | bazel/envoy_mobile_repositories.bzl | lyft/envoy-mobile | 218e317288f79915249e7bee33a4c8ec58cfd76d | [
"Apache-2.0"
] | 619 | 2019-06-17T22:22:59.000Z | 2020-11-11T03:58:27.000Z | bazel/envoy_mobile_repositories.bzl | lyft/envoy-mobile | 218e317288f79915249e7bee33a4c8ec58cfd76d | [
"Apache-2.0"
] | 40 | 2019-06-18T16:09:58.000Z | 2020-10-21T19:11:42.000Z | load("@bazel_gazelle//:deps.bzl", "go_repository")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file", "http_jar")
def envoy_mobile_repositories():
http_archive(
name = "google_bazel_common",
sha256 ... | 45.948454 | 134 | 0.711016 |
15d4aaba4b9be3204a4aa02c18b71e877908e5d1 | 12,168 | py | Python | code/python/QuotesAPIforDigitalPortals/v2/fds/sdk/QuotesAPIforDigitalPortals/model/inline_response20062_data_costs_and_charges_ex_ante_italy_one_off_maximum_fixed_entry_cost.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 6 | 2022-02-07T16:34:18.000Z | 2022-03-30T08:04:57.000Z | code/python/QuotesAPIforDigitalPortals/v2/fds/sdk/QuotesAPIforDigitalPortals/model/inline_response20062_data_costs_and_charges_ex_ante_italy_one_off_maximum_fixed_entry_cost.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | 2 | 2022-02-07T05:25:57.000Z | 2022-03-07T14:18:04.000Z | code/python/QuotesAPIforDigitalPortals/v2/fds/sdk/QuotesAPIforDigitalPortals/model/inline_response20062_data_costs_and_charges_ex_ante_italy_one_off_maximum_fixed_entry_cost.py | factset/enterprise-sdk | 3fd4d1360756c515c9737a0c9a992c7451d7de7e | [
"Apache-2.0"
] | null | null | null | """
Prime Developer Trial
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from fds.sdk.Q... | 45.744361 | 207 | 0.59525 |
7e9c7fa9c7e156b6390334f822408a89fdaf4271 | 979 | py | Python | azure/mgmt/network/v2017_09_01/models/load_balancer_paged.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2017_09_01/models/load_balancer_paged.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | azure/mgmt/network/v2017_09_01/models/load_balancer_paged.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# C... | 34.964286 | 134 | 0.564862 |
9d4c02bc4986d5a1207a4704cc64330dc2b5996b | 8,937 | py | Python | lib/rucio/daemons/conveyor/stager.py | R-16Bob/rucio | fb5ae7f177775532665982c01886386f296e3c54 | [
"Apache-2.0"
] | null | null | null | lib/rucio/daemons/conveyor/stager.py | R-16Bob/rucio | fb5ae7f177775532665982c01886386f296e3c54 | [
"Apache-2.0"
] | null | null | null | lib/rucio/daemons/conveyor/stager.py | R-16Bob/rucio | fb5ae7f177775532665982c01886386f296e3c54 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2015-2022 CERN
#
# 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... | 39.026201 | 167 | 0.651785 |
7ec9042b9bf7734dbad88f1c0b3cc0e21aba627f | 481 | py | Python | blog/admin.py | SoushiCode/Mywebsite | ab25f278dfedc52151f4af339b66f30f72e05903 | [
"MIT"
] | null | null | null | blog/admin.py | SoushiCode/Mywebsite | ab25f278dfedc52151f4af339b66f30f72e05903 | [
"MIT"
] | null | null | null | blog/admin.py | SoushiCode/Mywebsite | ab25f278dfedc52151f4af339b66f30f72e05903 | [
"MIT"
] | null | null | null | from django.contrib import admin
from blog.models import Post
# Register your models here.
#admin.register(Post)
class PostAdmin (admin.ModelAdmin):
date_hierarchy ='created_date'
empty_value_display = '-empty-'
list_display = ('title','counted_views', 'status','published_date','created_date')
list_fi... | 32.066667 | 86 | 0.723493 |
0c1948b94c3b08f0d34061f9e3b3bef1f98df97d | 974 | py | Python | externals/pyglet-1.2.4/pyglet-1.2.4/tests/image/PLATFORM_RGBA_LOAD.py | Soulrez/psychsim-teamwork | 7c660a48c48664efcb863ba73bfbae2f5eb5566f | [
"MIT"
] | 1 | 2016-07-19T16:56:46.000Z | 2016-07-19T16:56:46.000Z | externals/pyglet-1.2.4/pyglet-1.2.4/tests/image/PLATFORM_RGBA_LOAD.py | Soulrez/psychsim-teamwork | 7c660a48c48664efcb863ba73bfbae2f5eb5566f | [
"MIT"
] | 1 | 2018-08-27T22:31:16.000Z | 2018-08-27T22:31:16.000Z | externals/pyglet-1.2.4/pyglet-1.2.4/tests/image/PLATFORM_RGBA_LOAD.py | Soulrez/psychsim-teamwork | 7c660a48c48664efcb863ba73bfbae2f5eb5566f | [
"MIT"
] | 1 | 2019-09-06T03:05:35.000Z | 2019-09-06T03:05:35.000Z | #!/usr/bin/env python
'''Test RGBA load using the platform decoder (QuickTime, Quartz, GDI+ or Gdk).
You should see the rgba.png image on a checkboard background.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import unittest
import base_load
from pyglet import compat_platform
if compat_platform.star... | 31.419355 | 81 | 0.758727 |
e27a9363e45d5ea42348ea839e7aa32adbde4810 | 4,166 | py | Python | tavern/util/extfunctions.py | hamx0r/tavern | 80c7ddbd4c88892ef7358e3b9d4c8be78dcac347 | [
"MIT"
] | null | null | null | tavern/util/extfunctions.py | hamx0r/tavern | 80c7ddbd4c88892ef7358e3b9d4c8be78dcac347 | [
"MIT"
] | null | null | null | tavern/util/extfunctions.py | hamx0r/tavern | 80c7ddbd4c88892ef7358e3b9d4c8be78dcac347 | [
"MIT"
] | null | null | null | import functools
import importlib
import logging
from . import exceptions
from .dict_util import deep_dict_merge
def get_pykwalify_logger(module):
"""Get logger for this module
Have to do it like this because the way that pykwalify load extension
modules means that getting the logger the normal way just... | 28.340136 | 77 | 0.668987 |
b418861d797c2c1a5f94e5252afad927eec55c8e | 1,470 | py | Python | examples/widgets/textarea/lv_example_textarea_2.py | nickzhuang0613/lvgl | b7e6f6763d6fa967bacaca5a60ee33321f73c8a5 | [
"MIT"
] | 5,238 | 2020-05-18T13:08:59.000Z | 2022-03-31T21:38:16.000Z | examples/widgets/textarea/lv_example_textarea_2.py | imliubo/lvgl | 93c1303ee7989d25216262e1d0ea244b59b975f6 | [
"MIT"
] | 1,590 | 2020-05-18T09:47:07.000Z | 2022-03-31T23:26:41.000Z | examples/widgets/textarea/lv_example_textarea_2.py | imliubo/lvgl | 93c1303ee7989d25216262e1d0ea244b59b975f6 | [
"MIT"
] | 1,214 | 2020-05-19T00:45:08.000Z | 2022-03-31T06:41:13.000Z | def ta_event_cb(e):
code = e.get_code()
ta = e.get_target()
if code == lv.EVENT.CLICKED or code == lv.EVENT.FOCUSED:
# Focus on the clicked text area
if kb != None:
kb.set_textarea(ta)
elif code == lv.EVENT.READY:
print("Ready, current text: " + ta.get_text())
# Cr... | 29.4 | 69 | 0.723129 |
8e33cc80064fc14ab8bd9d9d5f465902aa9fd757 | 881 | py | Python | pzip/__init__.py | imsweb/pzip | c1467aefe329802f6a7b1592b65ec7ba41963c0f | [
"MIT"
] | null | null | null | pzip/__init__.py | imsweb/pzip | c1467aefe329802f6a7b1592b65ec7ba41963c0f | [
"MIT"
] | null | null | null | pzip/__init__.py | imsweb/pzip | c1467aefe329802f6a7b1592b65ec7ba41963c0f | [
"MIT"
] | null | null | null | import builtins
from .base import (
Algorithm,
Close,
Compression,
InvalidFile,
Key,
KeyDerivation,
KeyMaterial,
Password,
PZip,
RawKey,
Tag,
)
from .reader import PZipReader
from .writer import PZipWriter
__version__ = "0.9.9"
__version_info__ = tuple(int(num) for num in _... | 18.744681 | 68 | 0.603859 |
c3fc148b3fecf86da43e4d2a6d3596bd8ef06f58 | 2,008 | py | Python | 08a_Classes.py | maximcondon/Appendix | b95c26f92c4083cdbce5461c1a55ea62a554f563 | [
"MIT"
] | null | null | null | 08a_Classes.py | maximcondon/Appendix | b95c26f92c4083cdbce5461c1a55ea62a554f563 | [
"MIT"
] | null | null | null | 08a_Classes.py | maximcondon/Appendix | b95c26f92c4083cdbce5461c1a55ea62a554f563 | [
"MIT"
] | null | null | null |
from random import randint
import sys
HEALTHY = 1
WOUNDED = 2
DEAD = 3
class Player:
# These are the attibutes: name, strength, health status...
def __init__(self, name, strength=1):
'''
Here you set the initial attributes of your object
It can take as many arguments as you need it to... | 27.135135 | 81 | 0.609064 |
5a4aafb3a55cb72db30d98ee84862a771b406c28 | 1,134 | py | Python | examples/multi_objective/test_4/opti_config_ex_4.py | gmonterovillar/HAMON | 08ccaf3a2182b5ff647f942dcc3da94f8912fb1f | [
"MIT"
] | 4 | 2019-02-11T15:20:39.000Z | 2021-04-26T09:33:28.000Z | examples/multi_objective/test_4/opti_config_ex_4.py | gmonterovillar/HAMON | 08ccaf3a2182b5ff647f942dcc3da94f8912fb1f | [
"MIT"
] | 3 | 2019-02-11T15:17:50.000Z | 2019-05-23T12:42:02.000Z | examples/multi_objective/test_4/opti_config_ex_4.py | gmonterovillar/HAMON | 08ccaf3a2182b5ff647f942dcc3da94f8912fb1f | [
"MIT"
] | 2 | 2019-06-02T21:29:31.000Z | 2021-11-24T19:51:39.000Z | ##============================ opti_config_ex_4.py ================================
# Config file for the minimization of f1(x) and f2(x) of the TNK function:
# f1(x) = x_1
# f2(x) = x_2
# Subjected to the following constraints:
# x_1^2 - x_2^2 + 1 + 0.1cos(16arctan(x_1/x_2)) < 0
# (x_1 - 0.5)^2 + (x_2 - 0.5)^2 - 0.5 ... | 27.658537 | 101 | 0.544974 |
5ee640835b35b7e2527bcbd1d78d60fbbee73371 | 3,214 | py | Python | discord/handler.py | Quantumlyy/Disthon | 1c5856768544afada83e80efc207b877808705f1 | [
"MIT"
] | null | null | null | discord/handler.py | Quantumlyy/Disthon | 1c5856768544afada83e80efc207b877808705f1 | [
"MIT"
] | null | null | null | discord/handler.py | Quantumlyy/Disthon | 1c5856768544afada83e80efc207b877808705f1 | [
"MIT"
] | null | null | null | import typing
import aiohttp
class Handler:
def __init__(self):
self.base_url: str = 'https://discord.com/api/v9/'
self.user_agent: str = "Disthon test library V0.0.1b"
async def request(self, method: str, dest: str, *, headers: typing.Optional[dict] = None, data: typing.Optional[dict] = None... | 36.942529 | 157 | 0.573118 |
1a91069df86eb0fd4247fd8bc252590a721827ee | 4,055 | py | Python | rest_service/handlers.py | jeusgao/jobot_factory_nlp_simple | 4e11af5915d86c0c636997e3ee4e12d2a735a0d5 | [
"MIT"
] | null | null | null | rest_service/handlers.py | jeusgao/jobot_factory_nlp_simple | 4e11af5915d86c0c636997e3ee4e12d2a735a0d5 | [
"MIT"
] | null | null | null | rest_service/handlers.py | jeusgao/jobot_factory_nlp_simple | 4e11af5915d86c0c636997e3ee4e12d2a735a0d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author : Joe Gao (jeusgao@163.com)
import os
import atexit
import numpy as np
from fastapi import FastAPI
from itertools import product
from predictor import main
from utils import make_features
from storages import DIC_ZODB, milvusDB
app = FastAPI()
# app = FastAPI(... | 27.773973 | 112 | 0.623921 |
3e1072490cdc9491652d9d18dd5fe89b857af74f | 273 | py | Python | webapp/database.py | cortext/cortext-pytheas | ec05b49b7a2d08088962a3c69c3e23faeb020998 | [
"MIT"
] | 1 | 2022-03-29T09:44:18.000Z | 2022-03-29T09:44:18.000Z | webapp/database.py | cortext/cortext-pytheas | ec05b49b7a2d08088962a3c69c3e23faeb020998 | [
"MIT"
] | null | null | null | webapp/database.py | cortext/cortext-pytheas | ec05b49b7a2d08088962a3c69c3e23faeb020998 | [
"MIT"
] | 1 | 2019-10-15T19:52:00.000Z | 2019-10-15T19:52:00.000Z | import logging
from flask_pymongo import PyMongo
# mongo = PyMongo()
logger = logging.getLogger(__name__)
# print('test in db.py')
# logger.debug('test ?')
class Database:
# def __init__(self, app):
# self.app = app
def init_mongo(self, app):
return PyMongo(app) | 17.0625 | 36 | 0.703297 |
0d12393d72869c9d830e6d3445db889f037727e9 | 868 | py | Python | meross_iot/cloud/device_factory.py | cbolk/MerossIot | c743a154d98e191c01db2495b55e9cb525db30a4 | [
"MIT"
] | null | null | null | meross_iot/cloud/device_factory.py | cbolk/MerossIot | c743a154d98e191c01db2495b55e9cb525db30a4 | [
"MIT"
] | null | null | null | meross_iot/cloud/device_factory.py | cbolk/MerossIot | c743a154d98e191c01db2495b55e9cb525db30a4 | [
"MIT"
] | null | null | null | from meross_iot.cloud.devices.power_plugs import GenericPlug
from meross_iot.cloud.devices.light_bulbs import GenericBulb
from meross_iot.cloud.devices.door_openers import GenericGarageDoorOpener
def build_wrapper(
cloud_client,
device_type, # type: str
device_uuid, # type: str
... | 43.4 | 93 | 0.736175 |
a5289111ec88abaa95048a46a6477c22293965e2 | 9,201 | py | Python | tests/integration/test_trigger.py | binhnt101/watchman | 52124910aef276fa6d78564df5bc5079c7335e07 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_trigger.py | binhnt101/watchman | 52124910aef276fa6d78564df5bc5079c7335e07 | [
"Apache-2.0"
] | 2 | 2020-02-27T11:22:22.000Z | 2021-05-20T10:23:12.000Z | tests/integration/test_trigger.py | binhnt101/watchman | 52124910aef276fa6d78564df5bc5079c7335e07 | [
"Apache-2.0"
] | null | null | null | # vim:ts=4:sw=4:et:
# Copyright 2012-present Facebook, Inc.
# Licensed under the Apache License, Version 2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
# no unicode literals
import WatchmanTestCase
import json
import os
import os.path
import sys
import... | 38.497908 | 84 | 0.553744 |
cd4608b3d5a1d625b93d4a94496e5005692a3c6c | 9,558 | py | Python | apps/replay_lights/replay_lights.py | JoHa-git/ReplayLightsHistory | 266ea1dbcdf4420533924874dfc99e0e64cae17e | [
"Apache-2.0"
] | null | null | null | apps/replay_lights/replay_lights.py | JoHa-git/ReplayLightsHistory | 266ea1dbcdf4420533924874dfc99e0e64cae17e | [
"Apache-2.0"
] | null | null | null | apps/replay_lights/replay_lights.py | JoHa-git/ReplayLightsHistory | 266ea1dbcdf4420533924874dfc99e0e64cae17e | [
"Apache-2.0"
] | null | null | null | import appdaemon.plugins.hass.hassapi as hass
import pymysql.cursors
import sqlite3
import os
import json
from datetime import datetime
from datetime import timedelta
#
# Replay Light History when Away
#
# Args: Number of days back to replay
#
class ReplayLights(hass.Hass):
def initialize(self):
self.log("st... | 56.892857 | 205 | 0.480749 |
fe37b6c9293a587d8d968201a9847ed4c82d5913 | 4,712 | py | Python | src/IOT/serial_service.py | wolfbolin/Caremore | a38c24a9c0321ec442cff94110699d52466753dc | [
"Apache-2.0"
] | 1 | 2018-06-19T10:58:38.000Z | 2018-06-19T10:58:38.000Z | src/IOT/serial_service.py | wolfbolin/Caremore | a38c24a9c0321ec442cff94110699d52466753dc | [
"Apache-2.0"
] | null | null | null | src/IOT/serial_service.py | wolfbolin/Caremore | a38c24a9c0321ec442cff94110699d52466753dc | [
"Apache-2.0"
] | null | null | null | import time
import serial
import threading
def serial_service(serial_dict):
# Connect to uno board and sim board
sim_serial = serial.Serial("/dev/ttyAMA0", 19200, timeout=1)
uno_serial = serial.Serial("/dev/ttyUSB0", 115200, timeout=1)
# Check the connection
if uno_serial.isOpen():
serial... | 35.69697 | 92 | 0.508065 |
b0580fe422f63544a0e123643cd4f440071a49c5 | 434 | py | Python | weblinks/users/urls.py | rwoloszyn/weblinksd | 340a35e51fef3878f0b73fcc612eb12565096c67 | [
"MIT"
] | null | null | null | weblinks/users/urls.py | rwoloszyn/weblinksd | 340a35e51fef3878f0b73fcc612eb12565096c67 | [
"MIT"
] | null | null | null | weblinks/users/urls.py | rwoloszyn/weblinksd | 340a35e51fef3878f0b73fcc612eb12565096c67 | [
"MIT"
] | null | null | null | from django.urls import path
from weblinks.users.views import (
user_list_view,
user_redirect_view,
user_update_view,
user_detail_view,
)
app_name = "users"
urlpatterns = [
path("", view=user_list_view, name="list"),
path("~redirect/", view=user_redirect_view, name="redirect"),
path("~upda... | 25.529412 | 66 | 0.693548 |
af1e5cc1d41f1f7ce016fac3449531a2431b4c89 | 80 | py | Python | starknet_py/utils/data_transformer/__init__.py | Northa/starknet.py | a866b518e76d3ee7bc4fc6ae85058551c0aa4652 | [
"MIT"
] | 84 | 2021-12-15T10:45:13.000Z | 2022-03-30T11:05:24.000Z | starknet_py/utils/data_transformer/__init__.py | Northa/starknet.py | a866b518e76d3ee7bc4fc6ae85058551c0aa4652 | [
"MIT"
] | 56 | 2021-12-14T17:19:40.000Z | 2022-03-30T10:03:14.000Z | starknet_py/utils/data_transformer/__init__.py | Northa/starknet.py | a866b518e76d3ee7bc4fc6ae85058551c0aa4652 | [
"MIT"
] | 10 | 2022-01-02T18:36:11.000Z | 2022-03-25T22:20:59.000Z | from starknet_py.utils.data_transformer.data_transformer import DataTransformer
| 40 | 79 | 0.9125 |
d0900571b3daa636778a949bbb37d8e15ddd2499 | 8,942 | py | Python | heat/tests/openstack/neutron/test_neutron_segment.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 1 | 2018-07-04T07:59:26.000Z | 2018-07-04T07:59:26.000Z | heat/tests/openstack/neutron/test_neutron_segment.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | heat/tests/openstack/neutron/test_neutron_segment.py | noironetworks/heat | 7cdadf1155f4d94cf8f967635b98e4012a7acfb7 | [
"Apache-2.0"
] | 3 | 2018-07-19T17:43:37.000Z | 2019-11-15T22:13:30.000Z | #
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# ... | 41.398148 | 79 | 0.634422 |
36c27400cc9441761945c2d1033b1e5cf739e92e | 1,337 | py | Python | tensorflow_transform/__init__.py | rdmontgomery/transform | 8b1e1075a12757376c2f424a8dae8b3616d5cb3e | [
"Apache-2.0"
] | null | null | null | tensorflow_transform/__init__.py | rdmontgomery/transform | 8b1e1075a12757376c2f424a8dae8b3616d5cb3e | [
"Apache-2.0"
] | null | null | null | tensorflow_transform/__init__.py | rdmontgomery/transform | 8b1e1075a12757376c2f424a8dae8b3616d5cb3e | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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... | 41.78125 | 74 | 0.821242 |
691151a55741ad5e6497a2a42a0ce0bb3465f567 | 13,933 | py | Python | reegis/demand_heat.py | reegis/feed_reegis | 792e3dd1ffc53d955db0fd69401d3ccecd814239 | [
"MIT"
] | 3 | 2019-01-21T14:20:39.000Z | 2019-10-16T12:29:33.000Z | reegis/demand_heat.py | reegis/feed_reegis | 792e3dd1ffc53d955db0fd69401d3ccecd814239 | [
"MIT"
] | 18 | 2019-01-17T10:10:07.000Z | 2020-10-20T12:15:25.000Z | reegis/demand_heat.py | reegis/feed_reegis | 792e3dd1ffc53d955db0fd69401d3ccecd814239 | [
"MIT"
] | 4 | 2019-01-16T23:07:56.000Z | 2020-04-29T08:22:02.000Z | # -*- coding: utf-8 -*-
"""Processing a list of power plants in Germany.
SPDX-FileCopyrightText: 2016-2021 Uwe Krien <krien@uni-bremen.de>
SPDX-License-Identifier: MIT
"""
__copyright__ = "Uwe Krien <krien@uni-bremen.de>"
__license__ = "MIT"
# Python libraries
import os
import logging
# External libraries
import ... | 30.487965 | 79 | 0.580205 |
55da1d14866a30176ecd867c356b0ba3383f51fe | 5,411 | py | Python | src/__init__.py | bieniekmateusz/forcebalance | 593791866e622ab4eae23ce29a0bed27499a118d | [
"BSD-3-Clause"
] | 98 | 2015-03-31T06:42:14.000Z | 2022-03-13T12:07:37.000Z | src/__init__.py | bieniekmateusz/forcebalance | 593791866e622ab4eae23ce29a0bed27499a118d | [
"BSD-3-Clause"
] | 121 | 2015-07-13T15:57:02.000Z | 2022-03-24T20:07:10.000Z | src/__init__.py | bieniekmateusz/forcebalance | 593791866e622ab4eae23ce29a0bed27499a118d | [
"BSD-3-Clause"
] | 66 | 2015-04-06T03:05:04.000Z | 2022-02-26T05:11:59.000Z | from __future__ import print_function
from __future__ import absolute_import
from builtins import object
try:
__import__("numpy")
except ImportError:
print("Could not load numpy module, exiting...")
exit()
try:
__import__("scipy")
except ImportError:
print("Could not load scipy module, exiting...")... | 37.576389 | 138 | 0.646461 |
756d19fd92b4d838a1d4dd68aaad68a7df0ccde9 | 9,605 | py | Python | lightautoml/utils/timer.py | PhySci/LightAutoML | e860991ba36361629fe9e11e034c5e976fe4219b | [
"Apache-2.0"
] | 1 | 2021-10-02T05:28:16.000Z | 2021-10-02T05:28:16.000Z | lightautoml/utils/timer.py | DESimakov/LightAutoML | 2eaa05b27c63c613965d50cdb7d52da5d245d9af | [
"Apache-2.0"
] | null | null | null | lightautoml/utils/timer.py | DESimakov/LightAutoML | 2eaa05b27c63c613965d50cdb7d52da5d245d9af | [
"Apache-2.0"
] | null | null | null | """Timer."""
import logging
import warnings
from time import time
from typing import List
from typing import Optional
from typing import Union
import numpy as np
from .logging import DuplicateFilter
logger = logging.getLogger(__name__)
logger.addFilter(DuplicateFilter())
class Timer:
"""Timer to limit the d... | 29.373089 | 112 | 0.5924 |
eee984a966384e9460387ea7d7cd4a1f794ee1f4 | 34,848 | py | Python | anuvaad-etl/anuvaad-translator/translator/service/translatorservice.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | anuvaad-etl/anuvaad-translator/translator/service/translatorservice.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | anuvaad-etl/anuvaad-translator/translator/service/translatorservice.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | import json
import multiprocessing
import os
import random
import time
import uuid
from functools import partial
from multiprocessing import Process
from utilities.translatorutils import TranslatorUtils
from kafkawrapper.translatorproducer import Producer
from repository.translatorrepository import TranslatorRepositor... | 59.467577 | 130 | 0.573232 |
ad2f52a25620c438dfd65e6192c5898e2a20299b | 2,893 | py | Python | spiral_matrix.py | KevinLuo41/LeetCodeInPython | 051e1aab9bab17b0d63b4ca73473a7a00899a16a | [
"Apache-2.0"
] | 19 | 2015-01-19T19:36:09.000Z | 2020-03-18T03:10:12.000Z | spiral_matrix.py | CodingVault/LeetCodeInPython | 051e1aab9bab17b0d63b4ca73473a7a00899a16a | [
"Apache-2.0"
] | null | null | null | spiral_matrix.py | CodingVault/LeetCodeInPython | 051e1aab9bab17b0d63b4ca73473a7a00899a16a | [
"Apache-2.0"
] | 12 | 2015-04-25T14:20:38.000Z | 2020-09-27T04:59:59.000Z | #!/usr/bin/env python
# encoding: utf-8
"""
spiral_matrix.py
Created by Shengwei on 2014-07-27.
"""
# https://oj.leetcode.com/problems/spiral-matrix/
# tags: medium / hard, matrix, spacial, edge cases
"""
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For ex... | 32.505618 | 104 | 0.448669 |
97eda56160ee8d3b62dbed3d611526736ab2b329 | 1,134 | py | Python | options/test_options.py | Nash2325138/Shift-Net_pytorch | 005aaacaf77f4a5896a59b7eb90d44f7c6175a93 | [
"MIT"
] | null | null | null | options/test_options.py | Nash2325138/Shift-Net_pytorch | 005aaacaf77f4a5896a59b7eb90d44f7c6175a93 | [
"MIT"
] | null | null | null | options/test_options.py | Nash2325138/Shift-Net_pytorch | 005aaacaf77f4a5896a59b7eb90d44f7c6175a93 | [
"MIT"
] | null | null | null | from .base_options import BaseOptions
class TestOptions(BaseOptions):
def initialize(self, parser):
parser = BaseOptions.initialize(self, parser)
parser.add_argument('--ntest', type=int, default=float("inf"), help='# of test examples.')
parser.add_argument('--results_dir', type=str, defaul... | 59.684211 | 138 | 0.68254 |
adc509c4fa92ac7872344d46ac7609003a409a66 | 1,029 | py | Python | analysis/util.py | elv-youliangyu/youtube8m_v3 | 9b58d5b4ecb46429f687d4983a89b69d7d161015 | [
"Apache-2.0"
] | 18 | 2019-10-26T13:14:07.000Z | 2021-05-19T02:38:41.000Z | analysis/util.py | elv-youliangyu/youtube8m_v3 | 9b58d5b4ecb46429f687d4983a89b69d7d161015 | [
"Apache-2.0"
] | 2 | 2020-02-25T11:59:44.000Z | 2020-03-28T08:40:50.000Z | analysis/util.py | elv-youliangyu/youtube8m_v3 | 9b58d5b4ecb46429f687d4983a89b69d7d161015 | [
"Apache-2.0"
] | 5 | 2019-11-06T20:49:17.000Z | 2020-07-23T12:06:04.000Z |
def load_whitelist_topics(path="../segment_label_ids.csv"):
with open(path, 'r') as f:
return [int(x.rstrip("\n")) for x in f.readlines()[1:]]
def load_prediction_map(path, skip=1):
pred_map = {}
with open(path, 'r') as f:
for _ in range(skip):
f.readline()
for line in... | 28.583333 | 84 | 0.541302 |
b2c1e0eb5565166dd8687175d5679186682786d0 | 2,434 | py | Python | smashbot/slackpi.py | wray/slack_cttc | 1e8c8bfa646e32169ff76696d20d92bc9ca7d20e | [
"MIT"
] | null | null | null | smashbot/slackpi.py | wray/slack_cttc | 1e8c8bfa646e32169ff76696d20d92bc9ca7d20e | [
"MIT"
] | null | null | null | smashbot/slackpi.py | wray/slack_cttc | 1e8c8bfa646e32169ff76696d20d92bc9ca7d20e | [
"MIT"
] | 1 | 2017-11-06T17:54:10.000Z | 2017-11-06T17:54:10.000Z | import os
import sys
import time
from slackclient import SlackClient
import bot_id
import glob
import importlib
# Instructor and student imports
import wray.slacklib
import harrison.slacklib
# constants
try:
AT_BOT = "<@" + bot_id.get_id() + ">"
except TypeError:
pass
# instantiate client
slack_client = Sla... | 29.682927 | 75 | 0.644207 |
8078ecfe47157346040048813c2cabbb3961a6f0 | 190 | py | Python | print_npy.py | mmaguero/twitter-analysis | c7517a9d4a19af4a8c79ba85c1e5806f4a9ae6b8 | [
"MIT"
] | null | null | null | print_npy.py | mmaguero/twitter-analysis | c7517a9d4a19af4a8c79ba85c1e5806f4a9ae6b8 | [
"MIT"
] | null | null | null | print_npy.py | mmaguero/twitter-analysis | c7517a9d4a19af4a8c79ba85c1e5806f4a9ae6b8 | [
"MIT"
] | null | null | null | import numpy as np
import glob
import sys
pathN = sys.argv[1]
files = glob.glob(pathN + "/lda_doc*.npy")
for name in files:
a = np.load(name)
print(name, '\n', a)
print('Done!')
| 13.571429 | 42 | 0.631579 |
15cfdd33db9728e31cc8866e210cdfc55761f438 | 499 | py | Python | Libraries_and_Files/importing_02.py | ItaySharabi/LearnPython | 6b91e5143fbe5e44bdeeec671726ee6895890730 | [
"MIT"
] | 2 | 2022-02-16T21:41:45.000Z | 2022-03-01T12:39:56.000Z | Libraries_and_Files/importing_02.py | ItaySharabi/LearnPython | 6b91e5143fbe5e44bdeeec671726ee6895890730 | [
"MIT"
] | null | null | null | Libraries_and_Files/importing_02.py | ItaySharabi/LearnPython | 6b91e5143fbe5e44bdeeec671726ee6895890730 | [
"MIT"
] | null | null | null | # פייתון היא שפה שבה מאוד נהוג להשתמש בספריות חיצוניות
# ולכן נלמד מספר דרכים נוחות להתנהלות עם ספריות
# Import with alias
import math as m # בשורה זו ייבאנו את הספרייה המתמטית שהכרנו, ונתנו לה "שם בדוי"
# עכשיו נפנה לספריה עם השם `m`
print(f'You can give an alias to your import using the keyword `as`')
print(f'Now... | 35.642857 | 107 | 0.721443 |
7bf182b40c27715927be79cac393cc72cd0433d9 | 484 | py | Python | temporal/urls.py | zejn/django_temporal | c192a4f2bd052d14ae43795962e2451be22985d2 | [
"BSD-3-Clause"
] | 6 | 2015-02-25T22:37:20.000Z | 2021-12-27T09:03:29.000Z | temporal/urls.py | zejn/django_temporal | c192a4f2bd052d14ae43795962e2451be22985d2 | [
"BSD-3-Clause"
] | 3 | 2020-02-11T23:20:20.000Z | 2021-06-10T18:37:03.000Z | temporal/urls.py | zejn/django_temporal | c192a4f2bd052d14ae43795962e2451be22985d2 | [
"BSD-3-Clause"
] | 1 | 2015-02-12T22:08:55.000Z | 2015-02-12T22:08:55.000Z | from django.conf.urls.defaults import *
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Example:
# (r'^tdbbook/', include('tdbbook.foo.urls')),
# Uncomment the admin/doc line below to enable admin documentation:
... | 28.470588 | 71 | 0.683884 |
4afdc267de5cbd46c8d40bd69f3a968345d4e94a | 15,998 | py | Python | python/paddle/fluid/tests/unittests/test_merged_momentum_op.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/fluid/tests/unittests/test_merged_momentum_op.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_merged_momentum_op.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-09-24T11:23:36.000Z | 2021-09-24T11:23:36.000Z | # Copyright (c) 2021 PaddlePaddle 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 appli... | 39.114914 | 83 | 0.523065 |
10ab3e3d384d1c97cf855b3d51cff2c886e7869a | 8,052 | py | Python | cms/templatetags/cms_admin.py | Mario-Kart-Felix/django-cms | 6d68439fe7fd59d000f99e27c1f2135a3f9c816a | [
"BSD-3-Clause"
] | 1 | 2021-02-11T16:20:01.000Z | 2021-02-11T16:20:01.000Z | cms/templatetags/cms_admin.py | vlctt/django-cms | eeb86fd70c86b0cdac5f3959995b92de8d100771 | [
"BSD-3-Clause"
] | 2 | 2020-10-28T13:48:53.000Z | 2020-10-28T13:52:48.000Z | cms/templatetags/cms_admin.py | vlctt/django-cms | eeb86fd70c86b0cdac5f3959995b92de8d100771 | [
"BSD-3-Clause"
] | 1 | 2021-07-26T14:43:54.000Z | 2021-07-26T14:43:54.000Z | from classytags.arguments import Argument
from classytags.core import Options, Tag
from classytags.helpers import InclusionTag
from cms.constants import PUBLISHER_STATE_PENDING
from django import template
from django.conf import settings
from django.contrib.admin.views.main import ERROR_FLAG
from django.utils.encoding... | 33.272727 | 120 | 0.646796 |
46752b0620f0b7ec372590357ed7183dda70ab26 | 1,977 | py | Python | data/p4VQE/R4/benchmark/startCirq685.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startCirq685.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startCirq685.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=4
# total number=15
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 29.954545 | 77 | 0.694992 |
44972c0cbf73c0141143ae66fe113ac9c7efc667 | 16,056 | py | Python | bindings/gumjs/generate-runtime.py | jonwilson030981/frida-gum | d566cb92ffd5c735dab24ffb9c01c0e10147b026 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | bindings/gumjs/generate-runtime.py | jonwilson030981/frida-gum | d566cb92ffd5c735dab24ffb9c01c0e10147b026 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | bindings/gumjs/generate-runtime.py | jonwilson030981/frida-gum | d566cb92ffd5c735dab24ffb9c01c0e10147b026 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import unicode_literals, print_function
from base64 import b64decode
import codecs
import glob
import json
import os
import platform
import re
import subprocess
import sys
def generate_runtime_v8(runtime_name, output_dir, output, inputs):
with codecs.open(os.path.join(output... | 40.545455 | 179 | 0.631228 |
3f16770d61ecd02437542f3891254b77d7841d2a | 2,663 | py | Python | pxr/usd/lib/sdf/testenv/testSdfPayload.py | dalgos-adsk/USD | 65320d266057ae0a68626217f54a0298ac092799 | [
"AML"
] | 18 | 2017-10-28T22:37:48.000Z | 2022-01-26T12:00:24.000Z | pxr/usd/lib/sdf/testenv/testSdfPayload.py | piscees/USD | 65320d266057ae0a68626217f54a0298ac092799 | [
"AML"
] | null | null | null | pxr/usd/lib/sdf/testenv/testSdfPayload.py | piscees/USD | 65320d266057ae0a68626217f54a0298ac092799 | [
"AML"
] | 3 | 2019-12-03T16:46:14.000Z | 2021-08-23T14:56:21.000Z | #!/pxrpythonsubst
#
# Copyright 2017 Pixar
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 34.584416 | 89 | 0.589185 |
41bdbd9c481aba01c4dcf26cb8f9270cec34b5c0 | 5,987 | py | Python | src/hcrystalball/compose/_ts_column_transformer.py | ambader/hcrystalball | 713636e698d9a260fab982764fce4a13699be1a8 | [
"MIT"
] | 139 | 2020-06-29T16:36:16.000Z | 2022-01-25T21:49:10.000Z | src/hcrystalball/compose/_ts_column_transformer.py | ambader/hcrystalball | 713636e698d9a260fab982764fce4a13699be1a8 | [
"MIT"
] | 34 | 2020-06-29T12:31:26.000Z | 2022-03-18T13:56:21.000Z | src/hcrystalball/compose/_ts_column_transformer.py | ambader/hcrystalball | 713636e698d9a260fab982764fce4a13699be1a8 | [
"MIT"
] | 28 | 2020-06-30T06:00:39.000Z | 2022-03-18T13:27:58.000Z | from collections import namedtuple
import numpy as np
import pandas as pd
from scipy import sparse
from sklearn.compose import ColumnTransformer
from sklearn.utils.validation import check_array
from sklearn.utils.validation import check_is_fitted
class TSColumnTransformer(ColumnTransformer):
"""Time Series compa... | 33.824859 | 106 | 0.574745 |
0ce6b7745f0edaa79f23ff6e8a14741d7e542792 | 1,969 | py | Python | logextractx/test_logger.py | mrugacz95/logextractx | 9e7a91a57fa412b0d14a8c1361d8d362ba85fc75 | [
"Apache-2.0"
] | null | null | null | logextractx/test_logger.py | mrugacz95/logextractx | 9e7a91a57fa412b0d14a8c1361d8d362ba85fc75 | [
"Apache-2.0"
] | null | null | null | logextractx/test_logger.py | mrugacz95/logextractx | 9e7a91a57fa412b0d14a8c1361d8d362ba85fc75 | [
"Apache-2.0"
] | null | null | null | """ tests for logger.py part of code """
# pylint: disable=no-self-use
from . import logger as logger_mod
def test_getlogger(log_capture):
""" test if you can just log something with getLogger as drop-in replacement of
logging.getLogger """
logger = logger_mod.getLogger("foo.bar")
logger.info("FOO")
... | 35.160714 | 83 | 0.67547 |
79fc5fac4be81f2b506a79305d304b4562cd2505 | 10,290 | py | Python | vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py | mail2nsrajesh/vmware-nsx | 63154b510b9fd95c10fffae86bfc49073cafeb40 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py | mail2nsrajesh/vmware-nsx | 63154b510b9fd95c10fffae86bfc49073cafeb40 | [
"Apache-2.0"
] | null | null | null | vmware_nsx/shell/admin/plugins/nsxv/resources/networks.py | mail2nsrajesh/vmware-nsx | 63154b510b9fd95c10fffae86bfc49073cafeb40 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 VMware, 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 a... | 38.977273 | 78 | 0.615743 |
b4332b2b200a18e4765e75b607c91a05fb618923 | 2,103 | py | Python | setup.py | PythRs/umap | 8ffce460b403cffe91b268c871d77b23062e814d | [
"BSD-3-Clause"
] | null | null | null | setup.py | PythRs/umap | 8ffce460b403cffe91b268c871d77b23062e814d | [
"BSD-3-Clause"
] | null | null | null | setup.py | PythRs/umap | 8ffce460b403cffe91b268c871d77b23062e814d | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
def readme():
try:
with open("README.rst", encoding="UTF-8") as readme_file:
return readme_file.read()
except TypeError:
# Python 2.7 doesn't support encoding argument in builtin open
import io
with io.open("README.rst", encoding="UTF-8... | 29.208333 | 70 | 0.550642 |
af4938d5045e1bbf432520ccaf3565019215a123 | 3,491 | py | Python | tests/misc/test_crypto.py | StanHardy/impacket | 769c3196124af64d7bc08d51ae4b651e61a87037 | [
"Apache-1.1"
] | 8 | 2022-03-23T13:02:37.000Z | 2022-03-27T04:30:16.000Z | tests/misc/test_crypto.py | anno5750/impacket | ed7082cd0bc0d951f6eefb0a98c4c1360fe1a8a2 | [
"Apache-1.1"
] | null | null | null | tests/misc/test_crypto.py | anno5750/impacket | ed7082cd0bc0d951f6eefb0a98c4c1360fe1a8a2 | [
"Apache-1.1"
] | null | null | null | #!/usr/bin/env python
# Impacket - Collection of Python classes for working with network protocols.
#
# SECUREAUTH LABS. Copyright (C) 2021 SecureAuth Corporation. All rights reserved.
#
# This software is provided under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# f... | 41.070588 | 150 | 0.654827 |
f15e0c232bacf543f61441646509a5f96925b510 | 367 | py | Python | py/addtab.py | art5bv/BPSI | 18fca2f10491adeac56a1bde9d703d6da3a5ce2d | [
"MIT"
] | null | null | null | py/addtab.py | art5bv/BPSI | 18fca2f10491adeac56a1bde9d703d6da3a5ce2d | [
"MIT"
] | null | null | null | py/addtab.py | art5bv/BPSI | 18fca2f10491adeac56a1bde9d703d6da3a5ce2d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#!/usr/bin/env python3
#Creating a table
import sys, os.path
if __name__ == '__main__':
args = sys.argv[ 1: ]
outPath = os.path.normpath( args[ 0 ] )
outfile = open(outPath, 'w')
data = ["NAME","CLOUDS_%","SNOW_%","SNOW_index","VEGETATION_%","VEGETATION_index","MOISTURE_index"]
print... | 24.466667 | 99 | 0.645777 |
54a9d0fe911d817dc0fae278c57705df6b605ee1 | 487 | py | Python | prueba20.py | elviscruz45/POOAlgoritmoPython | c1f94a67d553c15f59a092030e880681c0300212 | [
"MIT"
] | null | null | null | prueba20.py | elviscruz45/POOAlgoritmoPython | c1f94a67d553c15f59a092030e880681c0300212 | [
"MIT"
] | null | null | null | prueba20.py | elviscruz45/POOAlgoritmoPython | c1f94a67d553c15f59a092030e880681c0300212 | [
"MIT"
] | null | null | null | import random
def ordenalista(lista):
if len(lista)>1:
medio=len(lista)//2
izquierda=lista[:medio]
derecha=lista[medio:]
print(izquierda,"*"*5,derecha)
ordenalista(izquierda)
ordenalista(derecha)
i=0
j=0
k=0
return print(lista)
long... | 19.48 | 61 | 0.628337 |
ef27167413b921d8fdbf04addce0e6543beff7e3 | 1,539 | py | Python | hypy/socialmedia.py | PikaFan123/hypy | e794df978a6937d95b6ce2eac9d73f31a51ac3eb | [
"MIT"
] | null | null | null | hypy/socialmedia.py | PikaFan123/hypy | e794df978a6937d95b6ce2eac9d73f31a51ac3eb | [
"MIT"
] | 1 | 2021-08-06T08:10:25.000Z | 2021-08-06T08:10:25.000Z | hypy/socialmedia.py | PikaFan123/hypy | e794df978a6937d95b6ce2eac9d73f31a51ac3eb | [
"MIT"
] | null | null | null | from typing import Optional
class SocialMedia:
"""Hypixel Social Media response wrapper"""
def __init__(self, raw):
self._raw = raw
def _get_social(self, social) -> Optional[str]:
if "socialMedia" not in self._raw:
return None
if "links" not in self._raw["socialMedia"... | 28.5 | 69 | 0.606888 |
11bd629d630cbae2edf0109f354c08e8806cab05 | 1,906 | py | Python | operator_api/ledger/migrations/0025_auto_20180824_1558.py | liquidity-network/nocust-hub | 76f49f9b8a6c264fcbe9e0c110e98031d463c0a8 | [
"MIT"
] | 1 | 2021-08-04T06:09:46.000Z | 2021-08-04T06:09:46.000Z | operator_api/ledger/migrations/0025_auto_20180824_1558.py | liquidity-network/nocust-hub | 76f49f9b8a6c264fcbe9e0c110e98031d463c0a8 | [
"MIT"
] | 8 | 2020-11-01T19:48:21.000Z | 2022-02-10T14:12:25.000Z | operator_api/ledger/migrations/0025_auto_20180824_1558.py | liquidity-network/nocust-hub | 76f49f9b8a6c264fcbe9e0c110e98031d463c0a8 | [
"MIT"
] | 3 | 2020-11-01T15:59:56.000Z | 2021-09-16T07:18:18.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.8 on 2018-08-24 15:58
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('ledger', '0024_auto_20180824_1525'),
]
operations ... | 32.862069 | 112 | 0.555089 |
cf0d2f786d87e74b25483017523b3834ef36b207 | 3,967 | py | Python | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/extensions.py | rahulkmr/cookiecutter-flask | 478c564a0f1ec26cc2403ec3970aa51bf50b4d3e | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/extensions.py | rahulkmr/cookiecutter-flask | 478c564a0f1ec26cc2403ec3970aa51bf50b4d3e | [
"MIT"
] | null | null | null | {{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/extensions.py | rahulkmr/cookiecutter-flask | 478c564a0f1ec26cc2403ec3970aa51bf50b4d3e | [
"MIT"
] | null | null | null | import simplejson as json
class Webpack(object):
def __init__(self, app=None):
self.app = app
self.assets_base_url = None
self.assets = {}
if app is not None:
self.init_app(app)
def init_app(self, app):
"""
Mutate the application passed in as expla... | 32.785124 | 80 | 0.58306 |
1fa53f6c1e263064ca65ce5b60220096da290347 | 2,414 | py | Python | examples/compute.py | berquist/obara-saika | 551fed4e442bee60f5e99a8d108df9aa08449510 | [
"BSD-3-Clause"
] | null | null | null | examples/compute.py | berquist/obara-saika | 551fed4e442bee60f5e99a8d108df9aa08449510 | [
"BSD-3-Clause"
] | null | null | null | examples/compute.py | berquist/obara-saika | 551fed4e442bee60f5e99a8d108df9aa08449510 | [
"BSD-3-Clause"
] | 1 | 2018-11-06T01:20:38.000Z | 2018-11-06T01:20:38.000Z | from __future__ import print_function
from itertools import product
import obarasaika.shell as shell
import obarasaika.obara_saika as os
za = 1.1
zb = 1.2
zc = 1.3
zd = 1.4
ra = [1.0, 0.0, 1.0]
rb = [0.0, 1.0, 2.0]
rc = [0.0, 0.0, 3.0]
rd = [0.0, 0.0, 4.0]
q_base = [0, 0, 0, 0, 0, 0]
q_small = [0, 1, 0, 0, 0, 1]... | 25.145833 | 78 | 0.60232 |
32895185928d03c5af61357f73edcacf9b03febe | 1,428 | pyde | Python | listing_56_1/listing_56_1.pyde | tiranderel/2019-fall-polytech-cs | 67f0482a0f143381f9b494a4348d6436ce8f8c1e | [
"MIT"
] | null | null | null | listing_56_1/listing_56_1.pyde | tiranderel/2019-fall-polytech-cs | 67f0482a0f143381f9b494a4348d6436ce8f8c1e | [
"MIT"
] | null | null | null | listing_56_1/listing_56_1.pyde | tiranderel/2019-fall-polytech-cs | 67f0482a0f143381f9b494a4348d6436ce8f8c1e | [
"MIT"
] | null | null | null | i=0
k=1
class MyLine:
centerX=0
centerY=0
length=0
angle=0
weight=0
def upDate():
global i, k
i=i+k
if(i==255):
k=-1
if(i==0):
k=1
def render (self):
global i, k
x1 = self.centerX - cos( self.angle )* ... | 24.20339 | 62 | 0.507003 |
580a7dedfd71f0ca7c3e4b73ed81c34e17c05de4 | 2,447 | py | Python | dask/dataframe/io/tests/test_orc.py | JimCircadian/dask | 212c1058c19fa543d60d9a294f8f9feda3e1c9dc | [
"BSD-3-Clause"
] | 1 | 2021-10-05T02:08:05.000Z | 2021-10-05T02:08:05.000Z | dask/dataframe/io/tests/test_orc.py | JimCircadian/dask | 212c1058c19fa543d60d9a294f8f9feda3e1c9dc | [
"BSD-3-Clause"
] | 1 | 2020-10-24T09:17:39.000Z | 2020-10-24T09:17:39.000Z | dask/dataframe/io/tests/test_orc.py | JimCircadian/dask | 212c1058c19fa543d60d9a294f8f9feda3e1c9dc | [
"BSD-3-Clause"
] | null | null | null | import os
import shutil
import tempfile
import pytest
from packaging.version import parse as parse_version
import dask.dataframe as dd
from dask.dataframe import read_orc
from dask.dataframe.optimize import optimize_dataframe_getitem
from dask.dataframe.utils import assert_eq
pytest.importorskip("pyarrow.orc")
# Sk... | 29.481928 | 77 | 0.67879 |
578e65eae4d6ce1c1031de84e84f39901c692df8 | 1,267 | py | Python | Object tracking on color/Color_tuner.py | jyothiprakashpanaik/ML-4-e | dfaa0bc21ae6309bca95d7ef8c5db0274ed3038a | [
"MIT"
] | 1 | 2021-10-01T18:12:05.000Z | 2021-10-01T18:12:05.000Z | Object tracking on color/Color_tuner.py | jyothiprakashpanaik/ML-4-e | dfaa0bc21ae6309bca95d7ef8c5db0274ed3038a | [
"MIT"
] | null | null | null | Object tracking on color/Color_tuner.py | jyothiprakashpanaik/ML-4-e | dfaa0bc21ae6309bca95d7ef8c5db0274ed3038a | [
"MIT"
] | 1 | 2021-10-01T18:17:45.000Z | 2021-10-01T18:17:45.000Z | # color Tuning
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
cv2.namedWindow("Color Tuning")
def nothing(x):
pass
cv2.createTrackbar("Low-Hue", "Color Tuning", 0, 179, nothing)
cv2.createTrackbar("Low-Sat", "Color Tuning", 0, 255, nothing)
cv2.createTrackbar("Low-Vis", "Color Tuning", 0, 255, nothing)
cv2.... | 23.462963 | 64 | 0.686661 |
6661638d98300bb7a8a944f220a5751f49424b6c | 1,304 | py | Python | languages/Server/xapi_td_downloader.py | zhuzhenping/XAPI3 | 86b8a61a664bd3bc8bb0305fa73484d28ea8ed95 | [
"BSD-2-Clause"
] | 49 | 2020-10-15T03:01:54.000Z | 2022-03-11T12:57:46.000Z | languages/Server/xapi_td_downloader.py | zhuzhenping/XAPI3 | 86b8a61a664bd3bc8bb0305fa73484d28ea8ed95 | [
"BSD-2-Clause"
] | 5 | 2020-12-07T17:58:16.000Z | 2021-10-01T09:31:51.000Z | languages/Server/xapi_td_downloader.py | zhuzhenping/XAPI3 | 86b8a61a664bd3bc8bb0305fa73484d28ea8ed95 | [
"BSD-2-Clause"
] | 33 | 2020-10-13T13:14:37.000Z | 2022-03-31T04:49:52.000Z | #!/bin/env python
import sys
sys.path.append(r'../Python')
import argparse
from td_spi import *
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--user', '-u', default='abc', help='用户名')
parser.add_argument('--password', '-p', default='123456', help='密码')
args = pa... | 24.148148 | 72 | 0.63727 |
2353f44b1633523aa1fd593248bb3fe1bdee5d33 | 579 | py | Python | application.py | hanbioinformatica/owe4a_basis | 6737d6f1ede74eb39d3799d719c969b5e9d654d0 | [
"Apache-2.0"
] | 1 | 2019-05-14T11:33:41.000Z | 2019-05-14T11:33:41.000Z | application.py | hanbioinformatica/owe4a_basis | 6737d6f1ede74eb39d3799d719c969b5e9d654d0 | [
"Apache-2.0"
] | null | null | null | application.py | hanbioinformatica/owe4a_basis | 6737d6f1ede74eb39d3799d719c969b5e9d654d0 | [
"Apache-2.0"
] | null | null | null | """
Basis voor een te ontwikkelen Flask applicatie
Creation: may 9, 2019
(c) HAN University of Applied Science
Author: Martijn van der Bruggen
Voor deployment op Azure WebApps is het noodzakelijk het bestand
de naam application.py te geven.
"""
from flask import Flask, request, make_response, render_template
app = Fl... | 24.125 | 81 | 0.735751 |
2c4659435e051b11bac8c3be4c36cc7ac9b1d16d | 60,835 | py | Python | saq/modules/__init__.py | ace-ecosystem/ACE | d17b5ef4bccf923ec6be5115fabe40f0627dab2d | [
"Apache-2.0"
] | 24 | 2019-09-21T21:09:45.000Z | 2022-03-15T19:48:13.000Z | saq/modules/__init__.py | ace-ecosystem/ACE | d17b5ef4bccf923ec6be5115fabe40f0627dab2d | [
"Apache-2.0"
] | 54 | 2019-09-16T20:06:30.000Z | 2021-08-18T22:22:08.000Z | saq/modules/__init__.py | ace-ecosystem/ACE | d17b5ef4bccf923ec6be5115fabe40f0627dab2d | [
"Apache-2.0"
] | 9 | 2019-09-08T13:35:55.000Z | 2021-01-03T15:23:37.000Z | # vim: sw=4:ts=4:et:cc=120
import datetime
import inspect
import json
import logging
import os
import os.path
import re
import signal
import sys
import threading
import time
import urllib.parse
import xml.etree.ElementTree as ET
import saq
from saq import graph_api
from saq.analysis import Analysis, Observable, MODU... | 43.114812 | 164 | 0.627402 |
309389e853949107dbc085b367d914d72e84be1a | 266 | py | Python | 14_Day_Higher_order_functions/exercises/12.py | diegofregolente/30-Days-Of-Python | e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267 | [
"Apache-2.0"
] | null | null | null | 14_Day_Higher_order_functions/exercises/12.py | diegofregolente/30-Days-Of-Python | e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267 | [
"Apache-2.0"
] | null | null | null | 14_Day_Higher_order_functions/exercises/12.py | diegofregolente/30-Days-Of-Python | e0cad31f6d5ab1384ad6fa5a5d24a84771d6c267 | [
"Apache-2.0"
] | null | null | null | countries = ['Estonia', 'Finland', 'Sweden', 'Denmark', 'Norway', 'Iceland']
def morethansix(country):
if len(country) >= 6:
return True
else:
return False
countriessixormore = filter(morethansix, countries)
print(list(countriessixormore)) | 24.181818 | 76 | 0.672932 |
fbaf6bc18584c571ab0be38a13abdbfc597cc41c | 2,778 | py | Python | monk/system_unit_tests/keras/test_initializer_xavier_normal.py | Shreyashwaghe/monk_v1 | 4ee4d9483e8ffac9b73a41f3c378e5abf5fc799b | [
"Apache-2.0"
] | 7 | 2020-07-26T08:37:29.000Z | 2020-10-30T10:23:11.000Z | monk/system_unit_tests/keras/test_initializer_xavier_normal.py | mursalfk/monk_v1 | 62f34a52f242772186ffff7e56764e958fbcd920 | [
"Apache-2.0"
] | null | null | null | monk/system_unit_tests/keras/test_initializer_xavier_normal.py | mursalfk/monk_v1 | 62f34a52f242772186ffff7e56764e958fbcd920 | [
"Apache-2.0"
] | 1 | 2020-10-07T12:57:44.000Z | 2020-10-07T12:57:44.000Z | import os
import sys
sys.path.append("../../../monk/");
import psutil
from keras_prototype import prototype
from compare_prototype import compare
from common import print_start
from common import print_status
import tensorflow as tf
import numpy as np
def test_initializer_xavier_normal(system_dict):
forward = ... | 34.296296 | 102 | 0.62887 |
8932e0e02ad50e6537e3a0269450e4b193fe945f | 1,837 | py | Python | kubesys/http_request.py | kubesys/client-python | 2edf93f23a5eddf79b09bdb414b82620182217cf | [
"Apache-2.0"
] | 2 | 2021-09-28T06:04:58.000Z | 2021-11-08T14:11:25.000Z | kubesys/http_request.py | kubesys/kubernetes-client-python | 2edf93f23a5eddf79b09bdb414b82620182217cf | [
"Apache-2.0"
] | null | null | null | kubesys/http_request.py | kubesys/kubernetes-client-python | 2edf93f23a5eddf79b09bdb414b82620182217cf | [
"Apache-2.0"
] | 1 | 2021-12-16T09:31:22.000Z | 2021-12-16T09:31:22.000Z | from typing import Union
from kubesys.common import formatURL,getParams
import requests
import json
def createRequest(url,token,method="GET",body=None,verify=False,keep_json=False,**kwargs) -> Union[object,bool,str]:
response, OK, status_code = createRequestReturOriginal(formatURL(url,getParams(kwargs)),token,meth... | 36.019608 | 117 | 0.673925 |
1a5d18e71357348a639efdd76875e478d2d6a53b | 47 | py | Python | sympsi/__init__.py | dmtvanzanten/sympsi | d717d7ceac5ae2b928939f1eda8cbd06f4e18c29 | [
"BSD-3-Clause"
] | null | null | null | sympsi/__init__.py | dmtvanzanten/sympsi | d717d7ceac5ae2b928939f1eda8cbd06f4e18c29 | [
"BSD-3-Clause"
] | null | null | null | sympsi/__init__.py | dmtvanzanten/sympsi | d717d7ceac5ae2b928939f1eda8cbd06f4e18c29 | [
"BSD-3-Clause"
] | null | null | null | # sympsi global imports
from .qutility import * | 23.5 | 23 | 0.787234 |
c825843c0e479116dac10b8d262bf01a3eb230fe | 389 | py | Python | setup.py | marcinn/midicontrol | 2d6884fa032dfb7b40fd761b4d00d2a1db44af7d | [
"BSD-3-Clause"
] | null | null | null | setup.py | marcinn/midicontrol | 2d6884fa032dfb7b40fd761b4d00d2a1db44af7d | [
"BSD-3-Clause"
] | null | null | null | setup.py | marcinn/midicontrol | 2d6884fa032dfb7b40fd761b4d00d2a1db44af7d | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup
setup(name='midicontrol',
version='0.1',
description='Control any application shortcuts with midi controller',
url='http://github.com/marcinn/midicontrol',
author='Marcin Nowak',
author_email='marcin.j.nowak@gmail.com',
license='BSD',
packages=['mi... | 29.923077 | 75 | 0.663239 |
4aafab0014b207a178784ba5f664388ebe853e80 | 3,896 | py | Python | gfssi_e03_ssi_area.py | NingAnMe/GFSSI | 066ac3dcffe04927aa497ee8b2257bee3ec3789a | [
"MIT"
] | 1 | 2020-08-18T08:05:35.000Z | 2020-08-18T08:05:35.000Z | gfssi_e03_ssi_area.py | NingAnMe/GFSSI | 066ac3dcffe04927aa497ee8b2257bee3ec3789a | [
"MIT"
] | null | null | null | gfssi_e03_ssi_area.py | NingAnMe/GFSSI | 066ac3dcffe04927aa497ee8b2257bee3ec3789a | [
"MIT"
] | 1 | 2020-08-26T06:50:59.000Z | 2020-08-26T06:50:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time : 2019/8/12
@Author : AnNing
"""
import os
import h5py
import numpy as np
from lib.lib_read_ssi import FY4ASSI, FY3DSSI
from lib.lib_constant import FULL_VALUE
from lib.lib_get_index_by_lonlat import get_data_by_index, get_area_index
def _write_out_file(out... | 31.934426 | 119 | 0.561088 |
329fb4fcf5231eaf392d8f3511123e003885ffb8 | 961 | py | Python | astroquery/cosmosim/__init__.py | eteq/astroquery | 70db53f8f047a2ee3481fd3242e6b364bc1ca639 | [
"BSD-3-Clause"
] | 1 | 2021-03-20T00:07:01.000Z | 2021-03-20T00:07:01.000Z | astroquery/cosmosim/__init__.py | eteq/astroquery | 70db53f8f047a2ee3481fd3242e6b364bc1ca639 | [
"BSD-3-Clause"
] | null | null | null | astroquery/cosmosim/__init__.py | eteq/astroquery | 70db53f8f047a2ee3481fd3242e6b364bc1ca639 | [
"BSD-3-Clause"
] | 1 | 2021-03-20T00:07:05.000Z | 2021-03-20T00:07:05.000Z | """
CosmoSim Database Query Tool
-----------------------------
.. topic:: Revision History
Access to all cosmological simulations stored in the CosmoSim database, via the uws service.
http://www.cosmosim.org/uws/query
:Author: Austen M. Groener <Austen.M.Groener@drexel.edu>
"""
from astropy import confi... | 25.289474 | 96 | 0.639958 |
6cd3d8f2772425cd73d06e7e0f3aa74c23986d23 | 1,512 | py | Python | demos/p4-redirect.py | utep-cs-systems-courses/project1-shell-maguilar15 | fd9f8c4530d5a63c14e8d341163e8da8e7d1b23f | [
"BSD-3-Clause"
] | null | null | null | demos/p4-redirect.py | utep-cs-systems-courses/project1-shell-maguilar15 | fd9f8c4530d5a63c14e8d341163e8da8e7d1b23f | [
"BSD-3-Clause"
] | null | null | null | demos/p4-redirect.py | utep-cs-systems-courses/project1-shell-maguilar15 | fd9f8c4530d5a63c14e8d341163e8da8e7d1b23f | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python3
import os, sys, time, re
pid = os.getpid() # get and remember pid
os.write(1, ("About to fork (pid=%d)\n" % pid).encode())
rc = os.fork()
if rc < 0:
os.write(2, ("fork failed, returning %d\n" % rc).encode())
sys.exit(1)
elif rc == 0: # child
os.w... | 36 | 83 | 0.445767 |
b7b6e64dd89d867ab8ff23e9749c20f3960a706f | 45,547 | py | Python | src/python/turicreate/toolkits/style_transfer/style_transfer.py | sirahd/turicreate | 386efa4eb5033573ee9120704a8c88a9a6151133 | [
"BSD-3-Clause"
] | null | null | null | src/python/turicreate/toolkits/style_transfer/style_transfer.py | sirahd/turicreate | 386efa4eb5033573ee9120704a8c88a9a6151133 | [
"BSD-3-Clause"
] | null | null | null | src/python/turicreate/toolkits/style_transfer/style_transfer.py | sirahd/turicreate | 386efa4eb5033573ee9120704a8c88a9a6151133 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from __future__ import print_function as _
from __future__ import division as _
from... | 40.558326 | 149 | 0.598898 |
d31c2684d5ff33b5b7eea99566d0bc674dbe7b23 | 1,074 | py | Python | docs/project/execution_example.py | comp-think/2019-2020 | bc84bfdec25fcb394ade7d3068070801942eef80 | [
"CC0-1.0",
"CC-BY-4.0"
] | 16 | 2019-10-14T08:15:51.000Z | 2020-05-21T17:56:28.000Z | docs/project/execution_example.py | comp-think/2019-2020 | bc84bfdec25fcb394ade7d3068070801942eef80 | [
"CC0-1.0",
"CC-BY-4.0"
] | 39 | 2019-10-13T23:00:56.000Z | 2020-01-05T14:44:30.000Z | docs/project/execution_example.py | comp-think/2019-2020 | bc84bfdec25fcb394ade7d3068070801942eef80 | [
"CC0-1.0",
"CC-BY-4.0"
] | 4 | 2019-10-16T17:38:36.000Z | 2020-01-10T11:27:51.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Silvio Peroni <essepuntato@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for any purpose
# with or without fee is hereby granted, provided that the above copyright notice
# and this permission notice appear in all copies.
#
# THE SOFTWARE I... | 46.695652 | 95 | 0.774674 |
6a11dea6befc9b56b12b2492458fa592ea25ae8c | 2,398 | py | Python | tests/test_tools.py | mwbub/binary-evolution | 32a0a31f9f71d258685dcfcc6f9098b27bc63604 | [
"MIT"
] | null | null | null | tests/test_tools.py | mwbub/binary-evolution | 32a0a31f9f71d258685dcfcc6f9098b27bc63604 | [
"MIT"
] | null | null | null | tests/test_tools.py | mwbub/binary-evolution | 32a0a31f9f71d258685dcfcc6f9098b27bc63604 | [
"MIT"
] | null | null | null | import warnings
import unittest
import numpy as np
from galpy.orbit import Orbit
from galpy.potential import MWPotential2014, evaluatePotentials
from galpy.util.bovy_conversion import time_in_Gyr
from binary_evolution.tools import v_circ, v_esc, period, ecc_to_vel
# Factors for conversion from galpy internal units
_p... | 36.892308 | 79 | 0.588407 |
2ac9ec36dde7078f42efee911d57b0e89c92aaca | 690 | py | Python | src/kedro_example/example-pipeline.py | gavinln/kedro-example | 9a355395863b7867dac0ff1ea73437d57191947d | [
"Apache-2.0"
] | null | null | null | src/kedro_example/example-pipeline.py | gavinln/kedro-example | 9a355395863b7867dac0ff1ea73437d57191947d | [
"Apache-2.0"
] | null | null | null | src/kedro_example/example-pipeline.py | gavinln/kedro-example | 9a355395863b7867dac0ff1ea73437d57191947d | [
"Apache-2.0"
] | null | null | null | from kedro.pipeline import node, Pipeline
from kedro.io import DataCatalog, MemoryDataSet
from kedro.runner import SequentialRunner
# Prepare first node
def greeting():
return "Hello"
greeting_node = node(func=greeting, inputs=None, outputs="my_greeting")
# Run first node
print(greeting_node.run())
# Prepare... | 21.5625 | 71 | 0.750725 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.