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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7085a1fe5b988f68095a3af873e89d664908629 | 1,553 | py | Python | chainerui/views/log.py | chainer/chainerui | 91c5c26d9154a008079dbb0bcbf69b5590d105f7 | [
"MIT"
] | 185 | 2017-12-15T09:24:07.000Z | 2022-01-20T11:20:13.000Z | chainerui/views/log.py | chainer/chainerui | 91c5c26d9154a008079dbb0bcbf69b5590d105f7 | [
"MIT"
] | 191 | 2017-12-15T09:14:52.000Z | 2022-02-17T14:09:19.000Z | chainerui/views/log.py | chainer/chainerui | 91c5c26d9154a008079dbb0bcbf69b5590d105f7 | [
"MIT"
] | 29 | 2017-12-15T09:40:45.000Z | 2022-03-13T11:21:11.000Z | import datetime
from flask import jsonify
from flask import request
from flask.views import MethodView
from chainerui.database import db
from chainerui.models.log import Log
from chainerui.models.project import Project
from chainerui.models.result import Result
class LogAPI(MethodView):
def post(self, project_... | 30.45098 | 76 | 0.582743 | import datetime
from flask import jsonify
from flask import request
from flask.views import MethodView
from chainerui.database import db
from chainerui.models.log import Log
from chainerui.models.project import Project
from chainerui.models.result import Result
class LogAPI(MethodView):
def post(self, project_... | true | true |
f7085abad3d73b13460022c34a237ccc00a67785 | 5,529 | py | Python | unblob/handlers/compression/lz4.py | IoT-Inspector/unblob | 4a6c871dae6805a922e55d30a7925910dc6a4eda | [
"MIT"
] | 17 | 2021-11-23T10:05:24.000Z | 2022-03-10T15:40:41.000Z | unblob/handlers/compression/lz4.py | IoT-Inspector/unblob | 4a6c871dae6805a922e55d30a7925910dc6a4eda | [
"MIT"
] | 184 | 2021-11-22T12:25:05.000Z | 2022-03-31T16:27:41.000Z | unblob/handlers/compression/lz4.py | IoT-Inspector/unblob | 4a6c871dae6805a922e55d30a7925910dc6a4eda | [
"MIT"
] | 2 | 2021-11-25T09:34:01.000Z | 2022-02-18T00:14:23.000Z | """
LZ4 frame format definition: https://github.com/lz4/lz4/blob/dev/doc/lz4_Frame_format.md
"""
import io
from typing import Optional
from lz4.block import decompress
from structlog import get_logger
from unblob.extractors import Command
from ...file_utils import Endian, convert_int8, convert_int32
from ...models i... | 32.910714 | 138 | 0.657985 | import io
from typing import Optional
from lz4.block import decompress
from structlog import get_logger
from unblob.extractors import Command
from ...file_utils import Endian, convert_int8, convert_int32
from ...models import File, Handler, HexString, ValidChunk
logger = get_logger()
SKIPPABLE_FRAMES_MAGIC = [0x18... | true | true |
f7085c13fbffd806d01c4d4dbad4ef478c69338d | 901 | py | Python | utils/image_converter.py | ml-research/Learning-to-Break-Deep-Perceptual-Hashing | 12148e8ecd47faa1f816f52f56662c47cd240cc1 | [
"MIT"
] | 3 | 2021-11-28T06:18:58.000Z | 2022-01-27T08:14:43.000Z | utils/image_converter.py | ml-research/Learning-to-Break-Deep-Perceptual-Hashing | 12148e8ecd47faa1f816f52f56662c47cd240cc1 | [
"MIT"
] | null | null | null | utils/image_converter.py | ml-research/Learning-to-Break-Deep-Perceptual-Hashing | 12148e8ecd47faa1f816f52f56662c47cd240cc1 | [
"MIT"
] | 1 | 2021-12-25T10:51:21.000Z | 2021-12-25T10:51:21.000Z | from PIL import Image
import os
import sys
from os import listdir
from os.path import isfile, join
def main():
folder_path = sys.argv[1]
output_folder_path = folder_path + '_png'
try:
os.mkdir(output_folder_path)
except:
if not os.listdir(output_folder_path):
print('Folder... | 27.30303 | 79 | 0.644839 | from PIL import Image
import os
import sys
from os import listdir
from os.path import isfile, join
def main():
folder_path = sys.argv[1]
output_folder_path = folder_path + '_png'
try:
os.mkdir(output_folder_path)
except:
if not os.listdir(output_folder_path):
print('Folder... | true | true |
f7085e10c8d2e0b60f50b9c127218e92539ccc62 | 6,456 | py | Python | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/interface/interface_functions/front_end_common_edge_to_n_keys_mapper.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | 2 | 2020-11-01T13:22:11.000Z | 2020-11-01T13:22:20.000Z | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/interface/interface_functions/front_end_common_edge_to_n_keys_mapper.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/interface/interface_functions/front_end_common_edge_to_n_keys_mapper.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | # pacman imports
from pacman.model.routing_info.\
dict_based_partitioned_partition_n_keys_map import \
DictBasedPartitionedPartitionNKeysMap
# spinnMachine imports
from spinn_machine.utilities.progress_bar import ProgressBar
# front end common imports
from spinn_front_end_common.abstract_models.\
abstract... | 41.121019 | 79 | 0.632125 | from pacman.model.routing_info.\
dict_based_partitioned_partition_n_keys_map import \
DictBasedPartitionedPartitionNKeysMap
from spinn_machine.utilities.progress_bar import ProgressBar
from spinn_front_end_common.abstract_models.\
abstract_provides_incoming_partition_constraints import \
AbstractProvi... | true | true |
f7085f7940cae0246d6438b8165af7054d0bd8a5 | 1,293 | py | Python | creat_database_on_cloudant.py | HazemGabr232/Face_off | d45beeae73b32e3f6c42f3ecb5d28cc69e2bfe8c | [
"MIT"
] | 6 | 2019-01-20T15:56:48.000Z | 2021-05-19T06:28:28.000Z | creat_database_on_cloudant.py | HazemGabr232/Face_off | d45beeae73b32e3f6c42f3ecb5d28cc69e2bfe8c | [
"MIT"
] | null | null | null | creat_database_on_cloudant.py | HazemGabr232/Face_off | d45beeae73b32e3f6c42f3ecb5d28cc69e2bfe8c | [
"MIT"
] | 4 | 2018-12-12T18:45:40.000Z | 2019-01-26T12:04:47.000Z | from cloudant.client import Cloudant
from cloudant.error import CloudantException
from cloudant.result import Result, ResultByKey
client = Cloudant.iam("b3e03381-f624-4db8-a3da-3588bface309-bluemix", "sckyMGqNGv8CX9aIcTDbrhYZYhYBDUfEXAJuXuN8SB1D")
client.connect()
databaseName = "attendance_toqa"
myDatabase = client.cr... | 29.386364 | 117 | 0.723898 | from cloudant.client import Cloudant
from cloudant.error import CloudantException
from cloudant.result import Result, ResultByKey
client = Cloudant.iam("b3e03381-f624-4db8-a3da-3588bface309-bluemix", "sckyMGqNGv8CX9aIcTDbrhYZYhYBDUfEXAJuXuN8SB1D")
client.connect()
databaseName = "attendance_toqa"
myDatabase = client.cr... | false | true |
f7086129b7bd3d12551eac468949f7252bcec980 | 6,286 | py | Python | pdf_maker.py | jlvdb/the-wizz | 21e88888472d2598a0db861aef31076078628b8e | [
"Apache-2.0"
] | null | null | null | pdf_maker.py | jlvdb/the-wizz | 21e88888472d2598a0db861aef31076078628b8e | [
"Apache-2.0"
] | null | null | null | pdf_maker.py | jlvdb/the-wizz | 21e88888472d2598a0db861aef31076078628b8e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""This code is the main access point for the majority of users of The-wiZZ. It
takes an input subselection of a survey catalog, a The-wiZZ HDF5 data file, and
matches the two together to create a resultant clustering redshift estimate
that can then be turned into a redshift PDF. This code also ... | 54.66087 | 79 | 0.715399 |
import numpy as np
from the_wizz import core_utils
from the_wizz import pdf_maker_utils
from the_wizz import input_flags
if __name__ == "__main__":
print("")
print("The-wiZZ has begun conjuring: running pdf maker...")
args = input_flags.parse_input_pdf_args()
input_flags.print_args(args)
... | true | true |
f708620cad5142402febfbc989ae3b8a7258b902 | 2,648 | py | Python | apps/shop/models.py | Nicolaad/onlineweb4 | 5942eaf907d6824d5384147627def9edefdb9946 | [
"MIT"
] | null | null | null | apps/shop/models.py | Nicolaad/onlineweb4 | 5942eaf907d6824d5384147627def9edefdb9946 | [
"MIT"
] | null | null | null | apps/shop/models.py | Nicolaad/onlineweb4 | 5942eaf907d6824d5384147627def9edefdb9946 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import uuid
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.validators import MinValueValidator
from django.db import models
from rest_framework.exceptions import NotAcceptable
from apps.authentication... | 31.152941 | 80 | 0.687689 | import uuid
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.validators import MinValueValidator
from django.db import models
from rest_framework.exceptions import NotAcceptable
from apps.authentication.models import OnlineUse... | true | true |
f7086304767140feaa75fdfd87ef314fb7e3e72f | 2,300 | py | Python | isotope/run_tests.py | daixiang0/tools | 06ec9d04b426e9620eebfe04d265b0ba16c16f2f | [
"Apache-2.0"
] | 264 | 2018-02-19T05:29:09.000Z | 2022-03-31T18:25:15.000Z | isotope/run_tests.py | daixiang0/tools | 06ec9d04b426e9620eebfe04d265b0ba16c16f2f | [
"Apache-2.0"
] | 976 | 2018-04-26T18:44:43.000Z | 2022-03-31T21:46:37.000Z | isotope/run_tests.py | daixiang0/tools | 06ec9d04b426e9620eebfe04d265b0ba16c16f2f | [
"Apache-2.0"
] | 243 | 2018-01-22T21:06:17.000Z | 2022-03-28T13:14:26.000Z | #!/usr/bin/env python3
# Copyright Istio Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 37.096774 | 79 | 0.705217 |
import argparse
import logging
from runner import cluster, config as cfg, consts, entrypoint, mesh, pipeline
def main(args: argparse.Namespace) -> None:
log_level = getattr(logging, args.log_level)
logging.basicConfig(level=log_level, format='%(levelname)s\t> %(message)s')
config = cfg.from_toml_file(... | true | true |
f70863342fef175da268d31958ec978288c8b856 | 4,119 | py | Python | django/contrib/sitemaps/__init__.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 3 | 2016-07-08T23:49:32.000Z | 2018-04-15T22:55:01.000Z | django/contrib/sitemaps/__init__.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 27 | 2017-02-05T15:57:04.000Z | 2018-04-15T22:57:26.000Z | django/contrib/sitemaps/__init__.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | null | null | null | from django.contrib.sites.models import Site, get_current_site
from django.core import urlresolvers, paginator
from django.core.exceptions import ImproperlyConfigured
import urllib
PING_URL = "http://www.google.com/webmasters/tools/ping"
class SitemapNotFound(Exception):
pass
def ping_google(sitemap_ur... | 37.445455 | 170 | 0.616655 | from django.contrib.sites.models import Site, get_current_site
from django.core import urlresolvers, paginator
from django.core.exceptions import ImproperlyConfigured
import urllib
PING_URL = "http://www.google.com/webmasters/tools/ping"
class SitemapNotFound(Exception):
pass
def ping_google(sitemap_ur... | true | true |
f708636aeca4d0c54b5b01643f96122c0286f98e | 5,173 | py | Python | pyserver/pyserver_glue.py | lbouma/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | 15 | 2015-05-06T05:11:48.000Z | 2021-12-03T14:56:58.000Z | pyserver/pyserver_glue.py | landonb/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | null | null | null | pyserver/pyserver_glue.py | landonb/Cyclopath | d09d927a1e6f9e07924007fd39e8e807cd9c0f8c | [
"Apache-2.0"
] | 8 | 2015-05-06T05:11:36.000Z | 2020-11-04T05:11:22.000Z | # Copyright (c) 2006-2013 Regents of the University of Minnesota.
# For licensing terms, see the file LICENSE.
import os
import sys
# Pyserver's conf.py wants the pyserver directory to be the current directory.
# And for importing pyserver sub-modules to work, we need the pyserver
# directory to be the current direc... | 41.717742 | 78 | 0.684322 |
import os
import sys
# And for importing pyserver sub-modules to work, we need the pyserver
# directory to be the current directory. We also need to add the dir to
# sys.path.
# SYNC_ME: Search pyserver module name.
dirname_pyserver = 'pyserver'
# Check that INSTANCE is set.
# FIXME: Should INSTANCE (and other en... | false | true |
f70863889847fb1a163c7bc0a443fdebd98b7b02 | 10,304 | py | Python | src/tools/autoware_auto_avp_demo/launch/ms3_core.launch.py | rubis-lab/autoware_rubis | 498ec5ff4c448d456fa0c6fe2f17e02fbd13ddb9 | [
"Apache-2.0"
] | null | null | null | src/tools/autoware_auto_avp_demo/launch/ms3_core.launch.py | rubis-lab/autoware_rubis | 498ec5ff4c448d456fa0c6fe2f17e02fbd13ddb9 | [
"Apache-2.0"
] | null | null | null | src/tools/autoware_auto_avp_demo/launch/ms3_core.launch.py | rubis-lab/autoware_rubis | 498ec5ff4c448d456fa0c6fe2f17e02fbd13ddb9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020-2021, The Autoware Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 40.566929 | 97 | 0.712151 |
from ament_index_python import get_package_share_directory
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.actions import IncludeLaunchDescription
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.conditions import IfCondition
fro... | true | true |
f70866c7894b122e47ce5ce5260f234fc330a584 | 3,141 | py | Python | tools/telemetry/telemetry/page/gtest_test_results.py | iplo/Chain | 8bc8943d66285d5258fffc41bed7c840516c4422 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 231 | 2015-01-08T09:04:44.000Z | 2021-12-30T03:03:10.000Z | tools/telemetry/telemetry/page/gtest_test_results.py | xiaoyuyanran/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2017-02-14T21:55:58.000Z | 2017-02-14T21:55:58.000Z | tools/telemetry/telemetry/page/gtest_test_results.py | xiaoyuyanran/chromium | c7361d39be8abd1574e6ce8957c8dbddd4c6ccf7 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 268 | 2015-01-21T05:53:28.000Z | 2022-03-25T22:09:01.000Z | # Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import sys
import time
import unittest
from telemetry.page import page_test_results
class GTestTestResults(page_test_results.PageTestRes... | 34.516484 | 74 | 0.65425 |
import logging
import sys
import time
import unittest
from telemetry.page import page_test_results
class GTestTestResults(page_test_results.PageTestResults):
def __init__(self, output_stream):
super(GTestTestResults, self).__init__(output_stream)
self._timestamp = None
def _GetMs(self):
return (time... | true | true |
f70866f021973b2bbbd78644a63222e38c0f66c0 | 2,804 | py | Python | cleaning/cleaner.py | antonpaquin/IsItAnime | 72c2c15ae9bf3907a25b40378831ca4efd85cc5b | [
"MIT"
] | 11 | 2018-06-21T08:15:31.000Z | 2021-08-11T06:03:40.000Z | cleaning/cleaner.py | antonpaquin/IsItAnime | 72c2c15ae9bf3907a25b40378831ca4efd85cc5b | [
"MIT"
] | null | null | null | cleaning/cleaner.py | antonpaquin/IsItAnime | 72c2c15ae9bf3907a25b40378831ca4efd85cc5b | [
"MIT"
] | 1 | 2020-01-24T20:21:48.000Z | 2020-01-24T20:21:48.000Z | #! /usr/bin/python
from flask import Flask, request, jsonify
import boto3
import os
from queue import Queue
from threading import Thread
import time
s3 = boto3.client('s3')
s3_raw = boto3.resource('s3').Bucket('isitanime-data-raw')
s3_dest = boto3.resource('s3').Bucket('isitanime-data-clean')
app = Flask(__name__)
@... | 23.762712 | 66 | 0.566334 | from flask import Flask, request, jsonify
import boto3
import os
from queue import Queue
from threading import Thread
import time
s3 = boto3.client('s3')
s3_raw = boto3.resource('s3').Bucket('isitanime-data-raw')
s3_dest = boto3.resource('s3').Bucket('isitanime-data-clean')
app = Flask(__name__)
@app.route('/')
def ... | true | true |
f70867e30ba8f552834af7092af1c7537adc3095 | 1,198 | py | Python | tbx/people/blocks.py | elviva404/wagtail-torchbox | 718d9e2c4337073f010296932d369c726a01dbd3 | [
"MIT"
] | 103 | 2015-02-24T17:58:21.000Z | 2022-03-23T08:08:58.000Z | tbx/people/blocks.py | elviva404/wagtail-torchbox | 718d9e2c4337073f010296932d369c726a01dbd3 | [
"MIT"
] | 145 | 2015-01-13T17:13:43.000Z | 2022-03-29T12:56:20.000Z | tbx/people/blocks.py | elviva404/wagtail-torchbox | 718d9e2c4337073f010296932d369c726a01dbd3 | [
"MIT"
] | 57 | 2015-01-03T12:00:37.000Z | 2022-02-09T13:11:30.000Z | from wagtail.core import blocks
from wagtail.images.blocks import ImageChooserBlock
class StandoutItemsBlock(blocks.StructBlock):
class LinkBlock(blocks.StreamBlock):
internal = blocks.PageChooserBlock()
external = blocks.URLBlock()
class Meta:
required = False
max... | 25.489362 | 121 | 0.600167 | from wagtail.core import blocks
from wagtail.images.blocks import ImageChooserBlock
class StandoutItemsBlock(blocks.StructBlock):
class LinkBlock(blocks.StreamBlock):
internal = blocks.PageChooserBlock()
external = blocks.URLBlock()
class Meta:
required = False
max... | true | true |
f708682576c4e7833b45e1bc645efeeecf96c324 | 1,289 | py | Python | tests/test_nodes.py | commarla/python-nomad | 37df37e4de21e6f8ac41c6154e7f1f44f1800020 | [
"MIT"
] | 109 | 2016-06-06T09:18:02.000Z | 2022-03-17T17:41:20.000Z | tests/test_nodes.py | commarla/python-nomad | 37df37e4de21e6f8ac41c6154e7f1f44f1800020 | [
"MIT"
] | 104 | 2016-06-04T23:06:06.000Z | 2021-12-08T04:49:43.000Z | tests/test_nodes.py | commarla/python-nomad | 37df37e4de21e6f8ac41c6154e7f1f44f1800020 | [
"MIT"
] | 80 | 2016-06-05T00:33:23.000Z | 2021-11-20T15:17:38.000Z | import pytest
# integration tests requires nomad Vagrant VM or Binary running
def test_get_nodes(nomad_setup):
assert isinstance(nomad_setup.nodes.get_nodes(), list) == True
def test_get_nodes_prefix(nomad_setup):
nodes = nomad_setup.nodes.get_nodes()
prefix = nodes[0]["ID"][:4]
nomad_setup.nodes.ge... | 23.017857 | 66 | 0.753297 | import pytest
def test_get_nodes(nomad_setup):
assert isinstance(nomad_setup.nodes.get_nodes(), list) == True
def test_get_nodes_prefix(nomad_setup):
nodes = nomad_setup.nodes.get_nodes()
prefix = nodes[0]["ID"][:4]
nomad_setup.nodes.get_nodes(prefix=prefix)
def test_dunder_getitem_exist(nomad_set... | true | true |
f7086a22a8b6cbc948ed244b0ec6f73cdc2f4cd2 | 2,987 | py | Python | newsroom/evaluate/run.py | peter-xbs/newsroom_chinese | 7fcae68b2ea5584d08d0c48faee34a0734237e6b | [
"Apache-2.0"
] | null | null | null | newsroom/evaluate/run.py | peter-xbs/newsroom_chinese | 7fcae68b2ea5584d08d0c48faee34a0734237e6b | [
"Apache-2.0"
] | null | null | null | newsroom/evaluate/run.py | peter-xbs/newsroom_chinese | 7fcae68b2ea5584d08d0c48faee34a0734237e6b | [
"Apache-2.0"
] | null | null | null | ################################################################################
from subprocess import Popen, PIPE, STDOUT
from threading import Thread
import bz2, json, click
from newsroom import jsonl
from . import readiter
from tqdm import tqdm
###################################################################... | 22.628788 | 80 | 0.494811 |
from subprocess import Popen, PIPE, STDOUT
from threading import Thread
import bz2, json, click
from newsroom import jsonl
from . import readiter
from tqdm import tqdm
def _writer(process, dataset_file, keys):
for article in dataset_file:
subset = {k: article[k] for k in keys if k in article}
... | true | true |
f7086a4801ba30d289dac1b201115bb48bcbdc1f | 3,196 | py | Python | app/models.py | OmegaM/story | 421c457bc121d6ca418468199108da7bd9f96435 | [
"BSD-3-Clause"
] | null | null | null | app/models.py | OmegaM/story | 421c457bc121d6ca418468199108da7bd9f96435 | [
"BSD-3-Clause"
] | null | null | null | app/models.py | OmegaM/story | 421c457bc121d6ca418468199108da7bd9f96435 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Created with Pycharm IDEA
@Create on 2015/9/12 16:31
@my_story models.py
@author : OmegaMiao"""
from app import db, loginManager
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask.ext.login import User... | 29.592593 | 94 | 0.661139 |
from app import db, loginManager
from datetime import datetime
from werkzeug.security import generate_password_hash, check_password_hash
from flask.ext.login import UserMixin
class Story(db.Model):
__tablename__ = 'story'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
title = db.Colu... | true | true |
f7086a73213296163f142ee1d848a32e72f49d62 | 7,182 | py | Python | ckan/lib/app_globals.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 2 | 2015-07-17T19:09:52.000Z | 2017-08-30T20:23:44.000Z | ckan/lib/app_globals.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 12 | 2015-01-19T18:03:56.000Z | 2016-04-11T16:40:33.000Z | ckan/lib/app_globals.py | florianm/ckan | 1cfd98d591ac70b4eb81048bcd227b6c1354b1bf | [
"Apache-2.0"
] | 3 | 2015-03-31T06:19:42.000Z | 2016-06-27T15:32:28.000Z | ''' The application's Globals object '''
import logging
import time
from threading import Lock
import re
from paste.deploy.converters import asbool
from pylons import config
import ckan
import ckan.model as model
import ckan.logic as logic
log = logging.getLogger(__name__)
# mappings translate between config set... | 31.778761 | 82 | 0.623225 |
import logging
import time
from threading import Lock
import re
from paste.deploy.converters import asbool
from pylons import config
import ckan
import ckan.model as model
import ckan.logic as logic
log = logging.getLogger(__name__)
mappings = {
}
app_globals_from_config_details = {
'ckan.site_title': {},
... | true | true |
f7086ab559a469398539456d57d72ca300a38868 | 2,328 | py | Python | bot_config.py | enemchy/rpi-transmission-telegram-bot | 71ad3f9ed1c9c2111ac3cd416cd203ff661b67b0 | [
"MIT"
] | null | null | null | bot_config.py | enemchy/rpi-transmission-telegram-bot | 71ad3f9ed1c9c2111ac3cd416cd203ff661b67b0 | [
"MIT"
] | null | null | null | bot_config.py | enemchy/rpi-transmission-telegram-bot | 71ad3f9ed1c9c2111ac3cd416cd203ff661b67b0 | [
"MIT"
] | null | null | null | import configparser
class BotConfig:
def __init__(self, path):
parser = configparser.ConfigParser()
# open the file implicitly because parser.read() will not fail if file is not readable
file = open(path)
parser.read_file(file)
file.close()
if 'Bot' not in parser... | 29.846154 | 94 | 0.554553 | import configparser
class BotConfig:
def __init__(self, path):
parser = configparser.ConfigParser()
file = open(path)
parser.read_file(file)
file.close()
if 'Bot' not in parser.sections():
raise Exception('All parameters must reside in section ''Bot''... | true | true |
f7086ba816e8596d2d810b8a0cd6ad6a963370bb | 1,309 | py | Python | setup.py | qingzma/DBEst_MDN | 3a3e26bede308b70abfad07032dc16a07a170f34 | [
"BSD-2-Clause"
] | 1 | 2022-02-23T08:01:08.000Z | 2022-02-23T08:01:08.000Z | setup.py | qingzma/DBEst_MDN | 3a3e26bede308b70abfad07032dc16a07a170f34 | [
"BSD-2-Clause"
] | null | null | null | setup.py | qingzma/DBEst_MDN | 3a3e26bede308b70abfad07032dc16a07a170f34 | [
"BSD-2-Clause"
] | 2 | 2020-09-28T15:39:12.000Z | 2021-05-11T11:07:54.000Z | # -*- coding: utf-8 -*-
import os
from setuptools import find_packages, setup
with open('README.rst') as f:
readme = f.read()
# with open('LICENSE.txt') as f:
# licenses = f.read()
setup(
name='dbestclient',
version='2.0',
description='Model-based Approximate Query Processing (AQP) engine.',
... | 30.44186 | 152 | 0.638655 |
import os
from setuptools import find_packages, setup
with open('README.rst') as f:
readme = f.read()
setup(
name='dbestclient',
version='2.0',
description='Model-based Approximate Query Processing (AQP) engine.',
classifiers=[
'Development Status :: 2.0',
'License :: OSI Appr... | true | true |
f7086c4726768d3708f3740cbbb11df2243f6488 | 2,081 | py | Python | cyllene/m_user_cmd.py | 28left/psumathnotebooks | ec948216304e5f234a2f4d0f6bdcfaa1a10c435d | [
"MIT"
] | 1 | 2021-05-04T14:09:51.000Z | 2021-05-04T14:09:51.000Z | cyllene/m_user_cmd.py | 28left/psumathnotebooks | ec948216304e5f234a2f4d0f6bdcfaa1a10c435d | [
"MIT"
] | null | null | null | cyllene/m_user_cmd.py | 28left/psumathnotebooks | ec948216304e5f234a2f4d0f6bdcfaa1a10c435d | [
"MIT"
] | null | null | null |
import sympy as sp
import cyllene.f_aux as fa
import cyllene.f_functionclass as ff
import cyllene.f_compare as fc
def function(expr):
"""
Defines a function based on a syntax check
and a Function object, using lambda operator.
Returns a pure function.
"""
func = ff.Function(expr)
if fun... | 24.77381 | 77 | 0.596348 |
import sympy as sp
import cyllene.f_aux as fa
import cyllene.f_functionclass as ff
import cyllene.f_compare as fc
def function(expr):
func = ff.Function(expr)
if func.is_defined:
return lambda x: func.eval_at(x)
else:
issues_report=''.join(['\t' + str(i+1) + '. ' + func.issues[i]+'\n' ... | true | true |
f7086cc203e842715757a439d19fd452474498b5 | 106 | py | Python | src/windshape/__init__.py | Adrien4193/windshape | 4c73a4a85409f04518029f0ddb8bd7e3c60e4905 | [
"BSD-2-Clause"
] | null | null | null | src/windshape/__init__.py | Adrien4193/windshape | 4c73a4a85409f04518029f0ddb8bd7e3c60e4905 | [
"BSD-2-Clause"
] | null | null | null | src/windshape/__init__.py | Adrien4193/windshape | 4c73a4a85409f04518029f0ddb8bd7e3c60e4905 | [
"BSD-2-Clause"
] | null | null | null | from Commander import Commander
from gui.UserInterface import UserInterface
from log.Replay import Replay
| 26.5 | 43 | 0.867925 | from Commander import Commander
from gui.UserInterface import UserInterface
from log.Replay import Replay
| true | true |
f7086d6fd660e481fbc60dbc73e3939ebde70e73 | 2,070 | py | Python | bluesky/tests/test_bec.py | danielballan/bluesky | 868c42f6b6be33f320bb3b5100d59c5378d2b5af | [
"BSD-3-Clause"
] | null | null | null | bluesky/tests/test_bec.py | danielballan/bluesky | 868c42f6b6be33f320bb3b5100d59c5378d2b5af | [
"BSD-3-Clause"
] | 44 | 2015-06-30T21:04:52.000Z | 2019-09-19T11:11:52.000Z | bluesky/tests/test_bec.py | danielballan/bluesky | 868c42f6b6be33f320bb3b5100d59c5378d2b5af | [
"BSD-3-Clause"
] | 2 | 2015-07-01T00:30:41.000Z | 2016-10-03T16:26:32.000Z | import ast
from bluesky.plans import scan, grid_scan
import bluesky.preprocessors as bpp
import bluesky.plan_stubs as bps
from bluesky.preprocessors import SupplementalData
from bluesky.callbacks.best_effort import BestEffortCallback
def test_hints(RE, hw):
motor = hw.motor
expected_hint = {'fields': [motor.n... | 23.258427 | 74 | 0.658454 | import ast
from bluesky.plans import scan, grid_scan
import bluesky.preprocessors as bpp
import bluesky.plan_stubs as bps
from bluesky.preprocessors import SupplementalData
from bluesky.callbacks.best_effort import BestEffortCallback
def test_hints(RE, hw):
motor = hw.motor
expected_hint = {'fields': [motor.n... | true | true |
f7086dc9522222ece382e172353cf23a6d069ea8 | 2,160 | py | Python | rllib/algorithms/ac.py | 4kubo/rllib | 4f9f5f49916c7681675305b6c9a276b9e88c5e22 | [
"MIT"
] | null | null | null | rllib/algorithms/ac.py | 4kubo/rllib | 4f9f5f49916c7681675305b6c9a276b9e88c5e22 | [
"MIT"
] | null | null | null | rllib/algorithms/ac.py | 4kubo/rllib | 4f9f5f49916c7681675305b6c9a276b9e88c5e22 | [
"MIT"
] | null | null | null | """Actor-Critic Algorithm."""
from rllib.util.neural_networks.utilities import broadcast_to_tensor
from .abstract_algorithm import AbstractAlgorithm
class ActorCritic(AbstractAlgorithm):
r"""Implementation of Policy Gradient algorithm.
Policy-Gradient is an on-policy model-free control algorithm.
Policy... | 34.285714 | 87 | 0.683333 | from rllib.util.neural_networks.utilities import broadcast_to_tensor
from .abstract_algorithm import AbstractAlgorithm
class ActorCritic(AbstractAlgorithm):
def __init__(
self, num_policy_samples=15, standardize_returns=True, *args, **kwargs
):
super().__init__(num_policy_samples=num_policy_... | true | true |
f7086df80423a19c718962ed1d7dcca8367671f9 | 24,024 | py | Python | build/android/gyp/compile_resources.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | build/android/gyp/compile_resources.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | build/android/gyp/compile_resources.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | #!/usr/bin/env python
#
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Compile Android resources into an intermediate APK.
This can also generate an R.txt, and an .srcjar file containing the prope... | 35.538462 | 80 | 0.700716 |
import argparse
import collections
import multiprocessing.pool
import os
import re
import shutil
import subprocess
import sys
import zipfile
from xml.etree import ElementTree
from util import build_utils
from util import resource_utils
_SOURCE_ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(... | true | true |
f7086e93ee1b53d1996a2bb80c4d634d913be312 | 1,136 | py | Python | diarypro/diarypro/urls.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | diarypro/diarypro/urls.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | diarypro/diarypro/urls.py | abhim4536/remote_repository | abbe3eb4fef1eb2b7ca08b98261354c913a1a171 | [
"MIT"
] | null | null | null | """diarypro URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/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')
Class-base... | 36.645161 | 77 | 0.71831 | from django.contrib import admin
from django.urls import path
from diaryapp import views
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('',views.home_view, name='home'),
path('event/',views.diary_view, name='create event'),
... | true | true |
f708705384503395a107c1f697f4709d5586f514 | 27 | py | Python | dataset_generator/learning/imitation/iil-dagger/algorithms/__init__.py | rjean/duckie-segmentation | 5e720e1a96ef61c4560823030549ac1d5d16e2a4 | [
"Apache-2.0"
] | 1 | 2021-02-03T02:23:34.000Z | 2021-02-03T02:23:34.000Z | dataset_generator/learning/imitation/iil-dagger/algorithms/__init__.py | rjean/mobile-segmentation | 5e720e1a96ef61c4560823030549ac1d5d16e2a4 | [
"Apache-2.0"
] | null | null | null | dataset_generator/learning/imitation/iil-dagger/algorithms/__init__.py | rjean/mobile-segmentation | 5e720e1a96ef61c4560823030549ac1d5d16e2a4 | [
"Apache-2.0"
] | null | null | null | from .dagger import DAgger
| 13.5 | 26 | 0.814815 | from .dagger import DAgger
| true | true |
f708712d2f1c53c86869ad65b24cc045d49f7d91 | 16,068 | py | Python | src/biotite/sequence/io/gff/file.py | padix-key/biopython2experimental | d88ab895469f0ab0911056cc5fa16dde5d07fd63 | [
"BSD-3-Clause"
] | null | null | null | src/biotite/sequence/io/gff/file.py | padix-key/biopython2experimental | d88ab895469f0ab0911056cc5fa16dde5d07fd63 | [
"BSD-3-Clause"
] | null | null | null | src/biotite/sequence/io/gff/file.py | padix-key/biopython2experimental | d88ab895469f0ab0911056cc5fa16dde5d07fd63 | [
"BSD-3-Clause"
] | null | null | null | # This source code is part of the Biotite package and is distributed
# under the 3-Clause BSD License. Please see 'LICENSE.rst' for further
# information.
__name__ = "biotite.sequence.io.gff"
__author__ = "Patrick Kunzmann"
__all__ = ["GFFFile"]
import copy
import string
from urllib.parse import quote, unquote
import... | 37.023041 | 131 | 0.545681 |
__name__ = "biotite.sequence.io.gff"
__author__ = "Patrick Kunzmann"
__all__ = ["GFFFile"]
import copy
import string
from urllib.parse import quote, unquote
import warnings
from ....file import TextFile, InvalidFileError
from ...annotation import Location
_NOT_QUOTED = "".join(
[char for char in string.punctuat... | true | true |
f708725b346619d5750d7805256a417ecccab059 | 3,436 | py | Python | tests/st/auto_monad/test_auto_monad_layer.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/auto_monad/test_auto_monad_layer.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/auto_monad/test_auto_monad_layer.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 41.902439 | 107 | 0.659488 | from tqdm import tqdm
import numpy as np
import mindspore as ms
import mindspore.nn as nn
from mindspore.dataset import NumpySlicesDataset
from mindspore import context, Tensor
context.set_context(mode=context.GRAPH_MODE, device_target="Ascend")
class AutoEncoderTrainNetwork(nn.Cell):
def __init__(self):
... | true | true |
f708726a644aec2224002f120ebd80965a6d2684 | 2,156 | py | Python | Receipt.py | michael-canaran/python-practice | cdd99db85be39e5b6d3241fe84f2501fba64f567 | [
"MIT"
] | null | null | null | Receipt.py | michael-canaran/python-practice | cdd99db85be39e5b6d3241fe84f2501fba64f567 | [
"MIT"
] | null | null | null | Receipt.py | michael-canaran/python-practice | cdd99db85be39e5b6d3241fe84f2501fba64f567 | [
"MIT"
] | 1 | 2020-01-05T06:49:03.000Z | 2020-01-05T06:49:03.000Z | from datetime import *
class Receipt:
def __init__(self, member_number):
# Initialize the receipt as a list for future modifications (adding and removing items)
self.member_items = []
self.member_number = member_number
self.total = 0.0
self.total_tax = 0.0
#... | 39.925926 | 98 | 0.579314 | from datetime import *
class Receipt:
def __init__(self, member_number):
self.member_items = []
self.member_number = member_number
self.total = 0.0
self.total_tax = 0.0
def add_item(self, item):
self.member_items.append(item)
item_price ... | true | true |
f708727a0170e03a37c3bf2596268f06778aa9bf | 15,458 | py | Python | tests/hikari/internal/test_routes.py | Lunarmagpie/hikari | 3f4fed67f76c655845d379066f9d192e7dffd0b0 | [
"MIT"
] | null | null | null | tests/hikari/internal/test_routes.py | Lunarmagpie/hikari | 3f4fed67f76c655845d379066f9d192e7dffd0b0 | [
"MIT"
] | null | null | null | tests/hikari/internal/test_routes.py | Lunarmagpie/hikari | 3f4fed67f76c655845d379066f9d192e7dffd0b0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020 Nekokatt
# Copyright (c) 2021-present davfsa
#
# 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 t... | 47.709877 | 119 | 0.630677 | import mock
import pytest
from hikari import files
from hikari.internal import routes
from tests.hikari import hikari_test_helpers
class TestCompiledRoute:
@pytest.fixture()
def compiled_route(self):
return routes.CompiledRoute(
major_param_hash="abc123", route=mock.Mock(method="GET"), co... | true | true |
f70872dd11437754839b9ea7a1f1e156077dfca1 | 3,023 | py | Python | linked-list/linked_list.py | souparnabose99/data-structures-python | a98dd261644a59438fb75d7dc2b21cf159d5c41b | [
"MIT"
] | null | null | null | linked-list/linked_list.py | souparnabose99/data-structures-python | a98dd261644a59438fb75d7dc2b21cf159d5c41b | [
"MIT"
] | null | null | null | linked-list/linked_list.py | souparnabose99/data-structures-python | a98dd261644a59438fb75d7dc2b21cf159d5c41b | [
"MIT"
] | null | null | null | class Node:
def __init__(self, data):
self.data = data
self.next_node = None
class LinkedList:
def __init__(self):
self.head = None
self.no_of_nodes = 0
# O(1) for insertion at the start of LL
def insert_at_start(self, data):
self.no_of_nodes = sel... | 26.752212 | 75 | 0.604036 | class Node:
def __init__(self, data):
self.data = data
self.next_node = None
class LinkedList:
def __init__(self):
self.head = None
self.no_of_nodes = 0
def insert_at_start(self, data):
self.no_of_nodes = self.no_of_nodes + 1
new_node = Nod... | true | true |
f70873b78879a32a977f49722e43445d7f6d2272 | 1,085 | py | Python | api/getty.py | OppoZeit/OppoZeit | e14fe39e4dd0638f31407992a5e63a8b0932ccaf | [
"MIT"
] | null | null | null | api/getty.py | OppoZeit/OppoZeit | e14fe39e4dd0638f31407992a5e63a8b0932ccaf | [
"MIT"
] | 3 | 2020-10-22T20:42:53.000Z | 2020-10-22T20:42:57.000Z | api/getty.py | OppoZeit/OppoZeit | e14fe39e4dd0638f31407992a5e63a8b0932ccaf | [
"MIT"
] | null | null | null | from gettybase import Session
import unicodedata
import os
class Getty():
def __init__(self):
try:
self.s = Session(os.environ['getty_system_id'],
os.environ['getty_system_pass'],
os.environ['getty_user_name'],
... | 27.820513 | 109 | 0.5447 | from gettybase import Session
import unicodedata
import os
class Getty():
def __init__(self):
try:
self.s = Session(os.environ['getty_system_id'],
os.environ['getty_system_pass'],
os.environ['getty_user_name'],
... | false | true |
f70873fcb4f81fac7415f87caf48b171944f2b25 | 4,959 | py | Python | src/reporter/query_NTNENA.py | cnoelle/ngsi-timeseries-api | 77ed420c0a7532bcc13d941c0402f457cc40407a | [
"MIT"
] | null | null | null | src/reporter/query_NTNENA.py | cnoelle/ngsi-timeseries-api | 77ed420c0a7532bcc13d941c0402f457cc40407a | [
"MIT"
] | null | null | null | src/reporter/query_NTNENA.py | cnoelle/ngsi-timeseries-api | 77ed420c0a7532bcc13d941c0402f457cc40407a | [
"MIT"
] | null | null | null | from exceptions.exceptions import NGSIUsageError
from utils.jsondict import lookup_string_match
from flask import request
from reporter.reporter import _validate_query_params
from translators.crate import CrateTranslatorInstance
import logging
from .geo_query_handler import handle_geo_query
def query_NTNENA(id_=None,... | 35.676259 | 111 | 0.461182 | from exceptions.exceptions import NGSIUsageError
from utils.jsondict import lookup_string_match
from flask import request
from reporter.reporter import _validate_query_params
from translators.crate import CrateTranslatorInstance
import logging
from .geo_query_handler import handle_geo_query
def query_NTNENA(id_=None,... | true | true |
f708740d1be7649c7d1e4311e0c6417e165b7497 | 5,009 | py | Python | lab4/text_recognizer/models/line_cnn.py | Agyey/fsdl-text-recognizer-2021-labs | 4bd85042ab9f6decd78849bb655c197cc13ffc11 | [
"MIT"
] | 1 | 2021-03-16T11:00:42.000Z | 2021-03-16T11:00:42.000Z | lab4/text_recognizer/models/line_cnn.py | Agyey/fsdl-text-recognizer-2021-labs | 4bd85042ab9f6decd78849bb655c197cc13ffc11 | [
"MIT"
] | null | null | null | lab4/text_recognizer/models/line_cnn.py | Agyey/fsdl-text-recognizer-2021-labs | 4bd85042ab9f6decd78849bb655c197cc13ffc11 | [
"MIT"
] | null | null | null | from typing import Any, Dict
import argparse
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
CONV_DIM = 64
FC_DIM = 128
WINDOW_WIDTH = 28
WINDOW_STRIDE = 28
class ConvBlock(nn.Module):
"""
Simple 3x3 conv with padding size 1 (to leave the input size unchanged), followed by a Re... | 34.544828 | 124 | 0.5556 | from typing import Any, Dict
import argparse
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
CONV_DIM = 64
FC_DIM = 128
WINDOW_WIDTH = 28
WINDOW_STRIDE = 28
class ConvBlock(nn.Module):
def __init__(self, input_channels: int, output_channels: int, kernel_size: int = 3, stride: int ... | true | true |
f708744ed8de3fca2afaf6f8806fb9da1e654edb | 3,110 | py | Python | murano-7.0.0/contrib/plugins/cloudify_plugin/murano_cloudify_plugin/cloudify_client.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 91 | 2015-04-26T16:05:03.000Z | 2021-12-28T07:12:33.000Z | murano-7.0.0/contrib/plugins/cloudify_plugin/murano_cloudify_plugin/cloudify_client.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | murano-7.0.0/contrib/plugins/cloudify_plugin/murano_cloudify_plugin/cloudify_client.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 61 | 2015-05-19T22:56:34.000Z | 2021-06-01T05:38:53.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
# distributed under the Li... | 34.94382 | 79 | 0.688424 |
import threading
import time
import cloudify_rest_client
import cloudify_rest_client.exceptions as cloudify_exceptions
from murano.dsl import dsl
from oslo_config import cfg as config
from yaql.language import specs
from yaql.language import yaqltypes
import cfg
CONF = config.CONF
archive_upload_lock = threading.L... | true | true |
f708746a2f008b37d6cbf4a6b54de754b18a4b02 | 744 | py | Python | get_some_food/users/forms.py | asergeenko/get_some_food | a9cfc776193287d2f375437420e985961688d6ed | [
"MIT"
] | null | null | null | get_some_food/users/forms.py | asergeenko/get_some_food | a9cfc776193287d2f375437420e985961688d6ed | [
"MIT"
] | null | null | null | get_some_food/users/forms.py | asergeenko/get_some_food | a9cfc776193287d2f375437420e985961688d6ed | [
"MIT"
] | null | null | null | from django.contrib.auth import forms as admin_forms
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
User = get_user_model()
class UserChangeForm(admin_forms.UserChangeForm):
class Meta(admin_forms.UserChangeForm.Meta):
model = User
class UserCreati... | 28.615385 | 78 | 0.645161 | from django.contrib.auth import forms as admin_forms
from django.contrib.auth import get_user_model
from django.utils.translation import gettext_lazy as _
User = get_user_model()
class UserChangeForm(admin_forms.UserChangeForm):
class Meta(admin_forms.UserChangeForm.Meta):
model = User
class UserCreati... | true | true |
f7087490f6a7e5fd6864626d44154053d111408a | 998 | py | Python | Keyless Keyed Transpositional Cipher/compare index and list.py | AshwinBalaji52/Mobile-Computing-and-Security | a0404f0835169f3496f0b8be4ea20f953503b0a0 | [
"MIT"
] | null | null | null | Keyless Keyed Transpositional Cipher/compare index and list.py | AshwinBalaji52/Mobile-Computing-and-Security | a0404f0835169f3496f0b8be4ea20f953503b0a0 | [
"MIT"
] | null | null | null | Keyless Keyed Transpositional Cipher/compare index and list.py | AshwinBalaji52/Mobile-Computing-and-Security | a0404f0835169f3496f0b8be4ea20f953503b0a0 | [
"MIT"
] | null | null | null | from random import shuffle
counter=1
#index = None
index = []
#indexlist = []
decrypt_list = []
intermediate = []
words = ['B', 'A', 'L', 'K','J','I']
newwords = words.copy() # Copy words
shuffle(newwords) # Shuffle newwords
for i in range(len(words)):
for j in range(len(newwords)):
if(words[i... | 22.681818 | 72 | 0.643287 | from random import shuffle
counter=1
index = []
decrypt_list = []
intermediate = []
words = ['B', 'A', 'L', 'K','J','I']
newwords = words.copy() shuffle(newwords)
for i in range(len(words)):
for j in range(len(newwords)):
if(words[i]==newwords[j]):
index.append(j)
print("Original l... | true | true |
f70875724f8a4b9bfc1141e67d5af7e864ca6a2f | 637 | py | Python | data/compute_rates.py | addschile/qtps | 3220af82d409526463dc4fe9e4ea869d655c0bd8 | [
"MIT"
] | null | null | null | data/compute_rates.py | addschile/qtps | 3220af82d409526463dc4fe9e4ea869d655c0bd8 | [
"MIT"
] | null | null | null | data/compute_rates.py | addschile/qtps | 3220af82d409526463dc4fe9e4ea869d655c0bd8 | [
"MIT"
] | null | null | null | import numpy as np
from sys import argv
tobs = int(argv[1])
p0 = np.zeros(10)
p2 = np.zeros(10)
p1 = np.zeros(10)
Zab = np.zeros(10)
rate = np.zeros(10)
for i in range(10):
da = np.loadtxt('tobs%d/reweighted_hist_%d.dat'%(tobs,i))
p0[i] = np.exp(-da[-2,1])
p2[i] = np.exp(-da[-1,1])
p1[i] = np.exp(-da[-... | 21.965517 | 65 | 0.596546 | import numpy as np
from sys import argv
tobs = int(argv[1])
p0 = np.zeros(10)
p2 = np.zeros(10)
p1 = np.zeros(10)
Zab = np.zeros(10)
rate = np.zeros(10)
for i in range(10):
da = np.loadtxt('tobs%d/reweighted_hist_%d.dat'%(tobs,i))
p0[i] = np.exp(-da[-2,1])
p2[i] = np.exp(-da[-1,1])
p1[i] = np.exp(-da[-... | true | true |
f70876132e6e96ac713b78db6125d8884610491b | 1,428 | py | Python | pythonforandroid/recipes/shapely/__init__.py | surbhicis/python-for-android | f8472bd3048b72e06ab5defea2f51ffc5c5e7bed | [
"MIT"
] | 4 | 2020-05-19T01:49:51.000Z | 2021-11-08T09:41:05.000Z | pythonforandroid/recipes/shapely/__init__.py | basharbme/python-for-android | f8472bd3048b72e06ab5defea2f51ffc5c5e7bed | [
"MIT"
] | 6 | 2020-01-31T18:04:48.000Z | 2021-06-05T10:53:55.000Z | pythonforandroid/recipes/shapely/__init__.py | basharbme/python-for-android | f8472bd3048b72e06ab5defea2f51ffc5c5e7bed | [
"MIT"
] | 8 | 2017-07-20T05:34:04.000Z | 2021-08-03T08:21:32.000Z | from pythonforandroid.recipe import CythonRecipe
from os.path import join
class ShapelyRecipe(CythonRecipe):
version = '1.7a1'
url = 'https://github.com/Toblerity/Shapely/archive/{version}.tar.gz'
depends = ['setuptools', 'libgeos']
# Actually, this recipe seems to compile/install fine for python2, b... | 35.7 | 77 | 0.686275 | from pythonforandroid.recipe import CythonRecipe
from os.path import join
class ShapelyRecipe(CythonRecipe):
version = '1.7a1'
url = 'https://github.com/Toblerity/Shapely/archive/{version}.tar.gz'
depends = ['setuptools', 'libgeos']
conflicts = ['python2']
call_hostpython_via_targetp... | true | true |
f708761adcd1ea623e38e155f985cfb34bf530d5 | 8,240 | py | Python | tools/test.py | TillBeemelmanns/OpenPCDet | b7553c879d0ba36477931efe07a55adbc39823b9 | [
"Apache-2.0"
] | null | null | null | tools/test.py | TillBeemelmanns/OpenPCDet | b7553c879d0ba36477931efe07a55adbc39823b9 | [
"Apache-2.0"
] | null | null | null | tools/test.py | TillBeemelmanns/OpenPCDet | b7553c879d0ba36477931efe07a55adbc39823b9 | [
"Apache-2.0"
] | null | null | null | import os
import torch
from tensorboardX import SummaryWriter
import time
import glob
import re
import datetime
import argparse
from pathlib import Path
import torch.distributed as dist
from pcdet.datasets import build_dataloader
from pcdet.models import build_network
from pcdet.utils import common_utils
from pcdet.con... | 42.916667 | 120 | 0.681917 | import os
import torch
from tensorboardX import SummaryWriter
import time
import glob
import re
import datetime
import argparse
from pathlib import Path
import torch.distributed as dist
from pcdet.datasets import build_dataloader
from pcdet.models import build_network
from pcdet.utils import common_utils
from pcdet.con... | true | true |
f708766a0136ddf59a2750659fdfb2ffb6f801b9 | 100 | py | Python | scripts/factory_methods.py | dkorenci/ner_cro | 86b8040e1f5e92ff89f53f6ca5825b944afa210b | [
"Apache-2.0"
] | null | null | null | scripts/factory_methods.py | dkorenci/ner_cro | 86b8040e1f5e92ff89f53f6ca5825b944afa210b | [
"Apache-2.0"
] | null | null | null | scripts/factory_methods.py | dkorenci/ner_cro | 86b8040e1f5e92ff89f53f6ca5825b944afa210b | [
"Apache-2.0"
] | null | null | null | from scripts.bilstm_tagger import bilstm_tagger
from scripts.bilstm_tagger_model import build_model
| 33.333333 | 51 | 0.9 | from scripts.bilstm_tagger import bilstm_tagger
from scripts.bilstm_tagger_model import build_model
| true | true |
f708774dd84ff1e94a2e5b0a67504f9c44ba42f3 | 55,175 | py | Python | env/lib/python3.6/site-packages/pandas/core/panel.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 4 | 2018-11-27T01:35:30.000Z | 2022-01-27T01:17:11.000Z | env/lib/python3.6/site-packages/pandas/core/panel.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 3 | 2020-03-24T15:38:23.000Z | 2021-02-02T21:44:18.000Z | env/lib/python3.6/site-packages/pandas/core/panel.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 3 | 2019-12-24T18:46:58.000Z | 2021-09-04T11:57:13.000Z | """
Contains data structures designed for manipulating panel (3-dimensional) data
"""
# pylint: disable=E1103,W0231,W0212,W0621
from __future__ import division
import warnings
import numpy as np
from pandas.types.cast import (_infer_dtype_from_scalar,
_possibly_cast_item)
from pandas.t... | 34.965146 | 79 | 0.557698 | from __future__ import division
import warnings
import numpy as np
from pandas.types.cast import (_infer_dtype_from_scalar,
_possibly_cast_item)
from pandas.types.common import (is_integer, is_list_like,
is_string_like, is_scalar)
from pandas.types.miss... | true | true |
f7087785207517cbb4605c1c30cb4178a14909ce | 888 | py | Python | main/migrations/0002_auto_20200225_1930.py | MexsonFernandes/CustomYoloV3 | 0acde7613d3b202859b8bab21b9c3ee5432a61bf | [
"MIT"
] | null | null | null | main/migrations/0002_auto_20200225_1930.py | MexsonFernandes/CustomYoloV3 | 0acde7613d3b202859b8bab21b9c3ee5432a61bf | [
"MIT"
] | 4 | 2021-06-04T23:17:43.000Z | 2021-09-22T19:06:48.000Z | main/migrations/0002_auto_20200225_1930.py | MexsonFernandes/DjanYolo | ccdaa3ee45c55b8cc9ff00342d9d44f293e8500c | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-02-25 19:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main', '0001_initial'),
... | 30.62069 | 125 | 0.650901 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main', '0001_initial'),
]
operations = [
migrations.Add... | true | true |
f70877d517388341ba4068c28d5fd24a0f6420ac | 3,440 | py | Python | h5nastran/f06_reader.py | EmanueleCannizzaro/h5nastran | a4ac2e8e0600332a553048a79393f96bd090b2ea | [
"MIT",
"BSD-3-Clause"
] | 2 | 2019-09-18T06:37:13.000Z | 2020-05-26T11:58:03.000Z | h5nastran/f06_reader.py | EmanueleCannizzaro/h5nastran | a4ac2e8e0600332a553048a79393f96bd090b2ea | [
"MIT",
"BSD-3-Clause"
] | null | null | null | h5nastran/f06_reader.py | EmanueleCannizzaro/h5nastran | a4ac2e8e0600332a553048a79393f96bd090b2ea | [
"MIT",
"BSD-3-Clause"
] | 2 | 2018-08-11T16:46:37.000Z | 2022-03-06T18:19:33.000Z | from __future__ import print_function, absolute_import
from six import iteritems, iterkeys, itervalues
from six.moves import range
from _file_reader import FileReader
from f06_table import F06Table
class _DummyTable(object):
def __init__(self):
self.header = []
self.data = []
self.line_n... | 26.259542 | 68 | 0.571512 | from __future__ import print_function, absolute_import
from six import iteritems, iterkeys, itervalues
from six.moves import range
from _file_reader import FileReader
from f06_table import F06Table
class _DummyTable(object):
def __init__(self):
self.header = []
self.data = []
self.line_n... | true | true |
f70878ad9644433e31d9c6e041bb1c6ce2f75b22 | 33,195 | py | Python | fastlmm/inference/fastlmm_predictor.py | eric-czech/FaST-LMM | 497ac732f0cb25e328282cff42045afb70a99076 | [
"Apache-2.0"
] | null | null | null | fastlmm/inference/fastlmm_predictor.py | eric-czech/FaST-LMM | 497ac732f0cb25e328282cff42045afb70a99076 | [
"Apache-2.0"
] | null | null | null | fastlmm/inference/fastlmm_predictor.py | eric-czech/FaST-LMM | 497ac732f0cb25e328282cff42045afb70a99076 | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function #Python 2 & 3 compatibility
from __future__ import absolute_import
import numpy as np
import logging
import unittest
import os
import scipy.linalg as LA
import time
from pysnptools.snpreader import Bed,Pheno
from pysnptools.snpreader import SnpData,SnpReader
from pysnptools.kernel... | 57.83101 | 323 | 0.674318 | from __future__ import print_function from __future__ import absolute_import
import numpy as np
import logging
import unittest
import os
import scipy.linalg as LA
import time
from pysnptools.snpreader import Bed,Pheno
from pysnptools.snpreader import SnpData,SnpReader
from pysnptools.kernelreader import KernelNpz
from... | true | true |
f70878f0501f62bdd0dcc9249e96933340f8f1f2 | 1,680 | py | Python | practice/bst.py | haandol/dojo | c29dc54614bdfaf79eb4862ed9fa25974a0f5654 | [
"MIT"
] | null | null | null | practice/bst.py | haandol/dojo | c29dc54614bdfaf79eb4862ed9fa25974a0f5654 | [
"MIT"
] | null | null | null | practice/bst.py | haandol/dojo | c29dc54614bdfaf79eb4862ed9fa25974a0f5654 | [
"MIT"
] | null | null | null | class Node:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
self.height = 1
def insert(node, val):
if not node:
return Node(val)
if val <= node.val:
node.left = insert(node.left, val)
else:
node.right = insert(node.rig... | 18.26087 | 54 | 0.567262 | class Node:
def __init__(self, val):
self.val = val
self.left = None
self.right = None
self.height = 1
def insert(node, val):
if not node:
return Node(val)
if val <= node.val:
node.left = insert(node.left, val)
else:
node.right = insert(node.rig... | true | true |
f708790a5ceb4681c6c0ae68240047ad1efa7ac7 | 3,205 | py | Python | homeassistant/components/broadlink/sensor.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 2 | 2021-01-29T02:52:01.000Z | 2021-05-15T04:23:18.000Z | homeassistant/components/broadlink/sensor.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 68 | 2020-07-23T07:13:53.000Z | 2022-03-31T06:01:48.000Z | homeassistant/components/broadlink/sensor.py | switschel/core | 0ecca246bdc3028c30bf8ccbf2b4c7f2a8b3f9aa | [
"Apache-2.0"
] | 7 | 2021-03-20T12:34:01.000Z | 2021-12-02T10:13:52.000Z | """Support for Broadlink sensors."""
import logging
import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassis... | 31.732673 | 86 | 0.699844 | import logging
import voluptuous as vol
from homeassistant.components.sensor import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_ILLUMINANCE,
DEVICE_CLASS_POWER,
DEVICE_CLASS_TEMPERATURE,
PLATFORM_SCHEMA,
STATE_CLASS_MEASUREMENT,
SensorEntity,
)
from homeassistant.const import CONF_HOST, PERCENTA... | true | true |
f7087a5a75b94c165bd14d3b048d7d86623fcbe8 | 2,745 | py | Python | blackmamba/script/toggle_comments.py | oz90210/blackmamba | 65c82c8e99028d6fbb57098ce82d0a394df215a0 | [
"MIT"
] | null | null | null | blackmamba/script/toggle_comments.py | oz90210/blackmamba | 65c82c8e99028d6fbb57098ce82d0a394df215a0 | [
"MIT"
] | null | null | null | blackmamba/script/toggle_comments.py | oz90210/blackmamba | 65c82c8e99028d6fbb57098ce82d0a394df215a0 | [
"MIT"
] | null | null | null | #!python3
import re
from blackmamba.system import Pythonista
def _comment_line(line, hash_prefix=''):
stripped = line.strip()
if stripped.startswith('#'):
return line
if not stripped:
return hash_prefix + '# \n'
return hash_prefix + '# ' + line[len(hash_prefix):]
_UNCOMMENT_RE = ... | 22.5 | 106 | 0.63133 |
import re
from blackmamba.system import Pythonista
def _comment_line(line, hash_prefix=''):
stripped = line.strip()
if stripped.startswith('#'):
return line
if not stripped:
return hash_prefix + '# \n'
return hash_prefix + '# ' + line[len(hash_prefix):]
_UNCOMMENT_RE = re.compile... | true | true |
f7087a9747ae148c97e1d86f50ba57ad6830aec3 | 33,897 | py | Python | tests/test_primary.py | kerwindong/uptane | 113be3c8a1f05a021625e8b73316696063bbae7e | [
"MIT"
] | 135 | 2016-11-22T17:54:01.000Z | 2022-03-20T09:34:16.000Z | tests/test_primary.py | kerwindong/uptane | 113be3c8a1f05a021625e8b73316696063bbae7e | [
"MIT"
] | 182 | 2016-11-28T16:34:09.000Z | 2020-11-24T15:05:34.000Z | tests/test_primary.py | kerwindong/uptane | 113be3c8a1f05a021625e8b73316696063bbae7e | [
"MIT"
] | 52 | 2016-11-23T02:26:57.000Z | 2022-01-22T14:33:55.000Z | """
<Program Name>
test_primary.py
<Purpose>
Unit testing for uptane/clients/primary.py
<Copyright>
See LICENSE for licensing information.
"""
from __future__ import unicode_literals
import uptane # Import before TUF modules; may change tuf.conf values.
import unittest
import os.path
import time
import copy
i... | 36.764642 | 150 | 0.728354 | from __future__ import unicode_literals
import uptane
import unittest
import os.path
import time
import copy
import shutil
import hashlib
import iso8601
from six.moves.urllib.error import URLError
import tuf
import tuf.formats
import tuf.conf
import tuf.client.updater
import uptane.formats
import uptane.clients.pr... | true | true |
f7087addb93a393392d9800dc38093aa66036065 | 10,705 | py | Python | reegis/mobility.py | jnettels/reegis | fe50c124aa041b9faa494611cba6b833675115e4 | [
"MIT"
] | null | null | null | reegis/mobility.py | jnettels/reegis | fe50c124aa041b9faa494611cba6b833675115e4 | [
"MIT"
] | null | null | null | reegis/mobility.py | jnettels/reegis | fe50c124aa041b9faa494611cba6b833675115e4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Calculate the mobility demand.
SPDX-FileCopyrightText: 2016-2019 Uwe Krien <krien@uni-bremen.de>
SPDX-License-Identifier: MIT
"""
__copyright__ = "Uwe Krien <krien@uni-bremen.de>"
__license__ = "MIT"
import os
import pandas as pd
from collections import namedtuple
from reegis import geo... | 27.877604 | 79 | 0.616534 |
__copyright__ = "Uwe Krien <krien@uni-bremen.de>"
__license__ = "MIT"
import os
import pandas as pd
from collections import namedtuple
from reegis import geometries, config as cfg, tools, energy_balance
def format_kba_table(filename, sheet):
df = pd.read_excel(filename, sheet, skiprows=7, header=[0, 1])
... | true | true |
f7087b51d7ba26204dd3feb9b980fba59565ce46 | 5,841 | py | Python | configs/body/2d_kpt_sview_rgb_img/associative_embedding/aic/higherhrnet_w32_aic_512x512.py | robertpreda/mmpose | 42d00d7b5742ce89105e73dec1b72b4fea2cacde | [
"Apache-2.0"
] | 1,775 | 2020-07-10T01:20:01.000Z | 2022-03-31T16:31:50.000Z | configs/body/2d_kpt_sview_rgb_img/associative_embedding/aic/higherhrnet_w32_aic_512x512.py | ly015/mmpose | 2b4a5cf3197cb14832cb6b7ecb883c76084d7131 | [
"Apache-2.0"
] | 1,021 | 2020-07-11T11:40:24.000Z | 2022-03-31T14:32:26.000Z | configs/body/2d_kpt_sview_rgb_img/associative_embedding/aic/higherhrnet_w32_aic_512x512.py | ly015/mmpose | 2b4a5cf3197cb14832cb6b7ecb883c76084d7131 | [
"Apache-2.0"
] | 477 | 2020-07-11T11:27:51.000Z | 2022-03-31T09:42:25.000Z | _base_ = ['../../../../_base_/datasets/aic.py']
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=50)
evaluation = dict(interval=50, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=0.0015,
)
opti... | 28.773399 | 77 | 0.574046 | _base_ = ['../../../../_base_/datasets/aic.py']
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=50)
evaluation = dict(interval=50, metric='mAP', save_best='AP')
optimizer = dict(
type='Adam',
lr=0.0015,
)
opti... | true | true |
f7087c99a5c249176f2e6c4983fbe1fa781b8651 | 11,347 | py | Python | topaz/objects/ioobject.py | kostya/topaz | d9acd4723f70a19f9f96eea60ea961c5818febd8 | [
"BSD-3-Clause"
] | 7 | 2020-04-23T05:57:15.000Z | 2022-01-17T14:41:24.000Z | topaz/objects/ioobject.py | kostya/topaz | d9acd4723f70a19f9f96eea60ea961c5818febd8 | [
"BSD-3-Clause"
] | null | null | null | topaz/objects/ioobject.py | kostya/topaz | d9acd4723f70a19f9f96eea60ea961c5818febd8 | [
"BSD-3-Clause"
] | 1 | 2020-07-25T17:09:24.000Z | 2020-07-25T17:09:24.000Z | import os
from rpython.rlib.rpoll import POLLIN, PollError
from rpython.rlib import streamio
from topaz.coerce import Coerce
from topaz.error import error_for_oserror
from topaz.module import ClassDef
from topaz.modules.fcntl import fcntl
from topaz.objects.objectobject import W_Object
from topaz.objects.stringobject... | 34.177711 | 89 | 0.589848 | import os
from rpython.rlib.rpoll import POLLIN, PollError
from rpython.rlib import streamio
from topaz.coerce import Coerce
from topaz.error import error_for_oserror
from topaz.module import ClassDef
from topaz.modules.fcntl import fcntl
from topaz.objects.objectobject import W_Object
from topaz.objects.stringobject... | false | true |
f7087ca213f3e2731d33f44af33711a2e82b380c | 386 | py | Python | KOMORANPy/training/trainer.py | shineware/KOMORANPy | b8c1904b42a0bdfcd26c4c85cb37cd8cb48ffb6a | [
"Apache-2.0"
] | 2 | 2021-07-02T04:41:03.000Z | 2021-12-08T10:26:20.000Z | KOMORANPy/training/trainer.py | shineware/KOMORANPy | b8c1904b42a0bdfcd26c4c85cb37cd8cb48ffb6a | [
"Apache-2.0"
] | 1 | 2021-08-24T16:09:00.000Z | 2021-08-24T16:09:00.000Z | KOMORANPy/training/trainer.py | shineware/KOMORANPy | b8c1904b42a0bdfcd26c4c85cb37cd8cb48ffb6a | [
"Apache-2.0"
] | 1 | 2021-07-25T10:35:56.000Z | 2021-07-25T10:35:56.000Z | from KOMORANPy.training.model_builder import ModelBuilder
# corpus_builder = CorpusBuilder()
# # todo : 트레이닝 데이터 위치 ( 실제로는 바이너리 파일만 제공 될 예정 )
# corpus_builder.build_path("/Users/shinjunsoo/shineware/data/komoran_training_data", ".refine.txt")
# corpus_builder.save("corpus_build")
model_builder = ModelBuilder()
model_... | 35.090909 | 100 | 0.782383 | from KOMORANPy.training.model_builder import ModelBuilder
model_builder = ModelBuilder()
model_builder.build_path("corpus_build")
model_builder.save("../model")
| true | true |
f7087ce4c035b1fb1de188116f3653f00a4e8ccb | 581 | py | Python | web/project/settings/production.py | borzunov/django-forum | 37ee43327575e59a4f7e1fcaa9f3a1c0de08d2b3 | [
"MIT"
] | null | null | null | web/project/settings/production.py | borzunov/django-forum | 37ee43327575e59a4f7e1fcaa9f3a1c0de08d2b3 | [
"MIT"
] | null | null | null | web/project/settings/production.py | borzunov/django-forum | 37ee43327575e59a4f7e1fcaa9f3a1c0de08d2b3 | [
"MIT"
] | null | null | null | from .common import *
DEBUG = False
ALLOWED_HOSTS = [os.environ['HOST']]
EMAIL_HOST = os.environ['EMAIL_HOST']
EMAIL_PORT = int(os.environ['EMAIL_PORT'])
EMAIL_HOST_USER = os.environ['EMAIL_HOST_USER']
EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD']
EMAIL_USE_TLS = True
LOGGING = {
'version': 1,
... | 18.741935 | 55 | 0.580034 | from .common import *
DEBUG = False
ALLOWED_HOSTS = [os.environ['HOST']]
EMAIL_HOST = os.environ['EMAIL_HOST']
EMAIL_PORT = int(os.environ['EMAIL_PORT'])
EMAIL_HOST_USER = os.environ['EMAIL_HOST_USER']
EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD']
EMAIL_USE_TLS = True
LOGGING = {
'version': 1,
... | true | true |
f7087d2d98dd995de906a86e6eeae12f9b9f9d50 | 2,840 | py | Python | chembl_webresource_client/new_client.py | RowAnalytics/chembl_webresource_client | 74dc4cb463a118cff8be949a3acf79f0d43e1625 | [
"Apache-2.0"
] | 1 | 2019-08-06T02:14:02.000Z | 2019-08-06T02:14:02.000Z | chembl_webresource_client/new_client.py | RowAnalytics/chembl_webresource_client | 74dc4cb463a118cff8be949a3acf79f0d43e1625 | [
"Apache-2.0"
] | null | null | null | chembl_webresource_client/new_client.py | RowAnalytics/chembl_webresource_client | 74dc4cb463a118cff8be949a3acf79f0d43e1625 | [
"Apache-2.0"
] | null | null | null | __author__ = 'mnowotka'
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import requests
import requests_cache
from chembl_webresource_client.spore_client import Client, make_spore_function
from chembl_webresource_client.query_set import QuerySet
from chembl_webresource_... | 39.444444 | 127 | 0.549648 | __author__ = 'mnowotka'
try:
from urlparse import urlparse
except ImportError:
from urllib.parse import urlparse
import requests
import requests_cache
from chembl_webresource_client.spore_client import Client, make_spore_function
from chembl_webresource_client.query_set import QuerySet
from chembl_webresource_... | true | true |
f7087e3040b02607a04724ec8594d793d799f809 | 1,140 | py | Python | app/platforms/country_map_update.py | QuittyMR/etlas-collector | 0d2c444f1f0e125ee4accd425591c5468041e7f1 | [
"MIT"
] | null | null | null | app/platforms/country_map_update.py | QuittyMR/etlas-collector | 0d2c444f1f0e125ee4accd425591c5468041e7f1 | [
"MIT"
] | null | null | null | app/platforms/country_map_update.py | QuittyMR/etlas-collector | 0d2c444f1f0e125ee4accd425591c5468041e7f1 | [
"MIT"
] | null | null | null | import pickle
from appcore.services import Factory
from platforms.base_platform import BasePlatform
from platforms.helpers.mysql_connection import MysqlConnection
class CountryMapUpdate(BasePlatform):
API_URL = 'my.sql.server'
DB_SETTINGS = {
'hostname': API_URL,
'username': 'db_user',
... | 29.230769 | 104 | 0.636842 | import pickle
from appcore.services import Factory
from platforms.base_platform import BasePlatform
from platforms.helpers.mysql_connection import MysqlConnection
class CountryMapUpdate(BasePlatform):
API_URL = 'my.sql.server'
DB_SETTINGS = {
'hostname': API_URL,
'username': 'db_user',
... | true | true |
f7087efe256dff2d6a4ec38f5d6ad75443d254a4 | 645 | py | Python | DQM/L1TMonitorClient/python/L1EmulatorObjHfBitCountsQualityTests_cfi.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | DQM/L1TMonitorClient/python/L1EmulatorObjHfBitCountsQualityTests_cfi.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | DQM/L1TMonitorClient/python/L1EmulatorObjHfBitCountsQualityTests_cfi.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | # quality tests for L1 HfBitCounts trigger objects
import FWCore.ParameterSet.Config as cms
l1EmulatorObjHfBitCountsQualityTests = cms.EDAnalyzer("QualityTester",
qtList=cms.untracked.FileInPath('DQM/L1TMonitorClient/data/L1EmulatorObjHfBitCountsQualityTests.xml'),
QualityTestPrescaler=cms.untracked.int32(1)... | 37.941176 | 106 | 0.789147 |
import FWCore.ParameterSet.Config as cms
l1EmulatorObjHfBitCountsQualityTests = cms.EDAnalyzer("QualityTester",
qtList=cms.untracked.FileInPath('DQM/L1TMonitorClient/data/L1EmulatorObjHfBitCountsQualityTests.xml'),
QualityTestPrescaler=cms.untracked.int32(1),
getQualityTestsFromFile=cms.untracked.bool(Tr... | true | true |
f7087f18674824aa39489d7b07d80db3e4b0e9b8 | 543 | py | Python | tests/test_renderer.py | saeedou/adia | 86dc0c96c9b0bd804dff208e91c71a1958df56b0 | [
"MIT"
] | 17 | 2021-07-29T08:26:08.000Z | 2022-03-26T23:26:38.000Z | tests/test_renderer.py | saeedou/adia | 86dc0c96c9b0bd804dff208e91c71a1958df56b0 | [
"MIT"
] | 37 | 2021-07-28T08:19:23.000Z | 2021-09-24T17:31:07.000Z | tests/test_renderer.py | saeedou/adia | 86dc0c96c9b0bd804dff208e91c71a1958df56b0 | [
"MIT"
] | 3 | 2021-09-14T10:54:51.000Z | 2022-01-04T15:37:35.000Z | from adia.sequence import Module
from adia.renderer import ModulePlan, ItemStartPlan, ItemEndPlan, LEFT, RIGHT
def test_moduleplan():
p = ModulePlan(Module('foo'))
assert repr(p) == 'ModulePlan: foo'
def test_itemplans():
class Item:
def __repr__(self):
return 'foo -> bar'
item ... | 25.857143 | 77 | 0.609576 | from adia.sequence import Module
from adia.renderer import ModulePlan, ItemStartPlan, ItemEndPlan, LEFT, RIGHT
def test_moduleplan():
p = ModulePlan(Module('foo'))
assert repr(p) == 'ModulePlan: foo'
def test_itemplans():
class Item:
def __repr__(self):
return 'foo -> bar'
item ... | true | true |
f70880808b29b867495a1526a7f56ee717a2727a | 1,148 | py | Python | Dataset/Leetcode/valid/4/334.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/valid/4/334.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | Dataset/Leetcode/valid/4/334.py | kkcookies99/UAST | fff81885aa07901786141a71e5600a08d7cb4868 | [
"MIT"
] | null | null | null | def XXX(nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
len1 = len(nums1)
len2 = len(nums2)
if (len1 == 0) & (len2 == 0):
return 0
if (len1 != 0) & (len2 == 0):
if len1 % 2 == 0:
return (nums1[len1 // 2 - 1] + nums1[len1... | 25.511111 | 66 | 0.399826 | def XXX(nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
len1 = len(nums1)
len2 = len(nums2)
if (len1 == 0) & (len2 == 0):
return 0
if (len1 != 0) & (len2 == 0):
if len1 % 2 == 0:
return (nums1[len1 // 2 - 1] + nums1[len1... | false | true |
f70880fce66d165efef7e7785145b657a31e1092 | 8,699 | py | Python | tests/test_sflow.py | venkatmahalingam/sonic-swss | d9f28b64255db54310d3398119f13dfb3203f311 | [
"Apache-2.0"
] | 1 | 2021-09-01T07:10:04.000Z | 2021-09-01T07:10:04.000Z | tests/test_sflow.py | venkatmahalingam/sonic-swss | d9f28b64255db54310d3398119f13dfb3203f311 | [
"Apache-2.0"
] | null | null | null | tests/test_sflow.py | venkatmahalingam/sonic-swss | d9f28b64255db54310d3398119f13dfb3203f311 | [
"Apache-2.0"
] | null | null | null | import time
class TestSflow:
speed_rate_table = {
"400000": "400000",
"200000": "200000",
"100000": "100000",
"50000": "50000",
"40000": "40000",
"25000": "25000",
"10000": "10000",
"1000": "1000"
}
def setup_sflow(self, dvs):
self.ad... | 45.784211 | 133 | 0.697092 | import time
class TestSflow:
speed_rate_table = {
"400000": "400000",
"200000": "200000",
"100000": "100000",
"50000": "50000",
"40000": "40000",
"25000": "25000",
"10000": "10000",
"1000": "1000"
}
def setup_sflow(self, dvs):
self.ad... | true | true |
f708832eb4bf7df5624f7937c92fc996b2938f06 | 9,117 | py | Python | command.py | vapier/git-repo | a2e1854e0015f3335959e08ee1aa817fcb8779d9 | [
"Apache-2.0"
] | 1 | 2021-03-24T01:51:50.000Z | 2021-03-24T01:51:50.000Z | command.py | vapier/git-repo | a2e1854e0015f3335959e08ee1aa817fcb8779d9 | [
"Apache-2.0"
] | null | null | null | command.py | vapier/git-repo | a2e1854e0015f3335959e08ee1aa817fcb8779d9 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2008 The Android Open Source Project
#
# 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 ... | 31.546713 | 86 | 0.666338 |
import os
import optparse
import platform
import re
import sys
from event_log import EventLog
from error import NoSuchProjectError
from error import InvalidProjectGroupsError
WORKER_BATCH_SIZE = 32
DEFAULT_LOCAL_JOBS = min(os.cpu_count(), 8)
class Command(object):
common = False
event_log = EventLog()
ma... | true | true |
f708844850409e8b816eb505e866c0d4f24940d2 | 2,400 | py | Python | tutorials/cdr/utils.py | eloriundo/snorkel | 746374b94c1558357ecb5bc07927dcc453239b3e | [
"Apache-2.0"
] | 2 | 2019-01-08T02:30:35.000Z | 2019-03-13T07:00:34.000Z | tutorials/cdr/utils.py | sduttap16/snorkel | bbbc1a38295d9411dbb792777e7d834865c0fd63 | [
"Apache-2.0"
] | null | null | null | tutorials/cdr/utils.py | sduttap16/snorkel | bbbc1a38295d9411dbb792777e7d834865c0fd63 | [
"Apache-2.0"
] | 2 | 2018-12-01T17:10:01.000Z | 2018-12-28T09:16:41.000Z | import bz2
from six.moves.cPickle import load
from string import punctuation
def offsets_to_token(left, right, offset_array, lemmas, punc=set(punctuation)):
token_start, token_end = None, None
for i, c in enumerate(offset_array):
if left >= c:
token_start = i
if c > right and toke... | 37.5 | 79 | 0.585417 | import bz2
from six.moves.cPickle import load
from string import punctuation
def offsets_to_token(left, right, offset_array, lemmas, punc=set(punctuation)):
token_start, token_end = None, None
for i, c in enumerate(offset_array):
if left >= c:
token_start = i
if c > right and toke... | true | true |
f70884914a35420087f57ef29fe00e211e674b21 | 219 | py | Python | misc/udp_sender2.py | RyanC1681/RCAI1122 | c9683110b58c255a7a78d880ff73df7ff2329405 | [
"Apache-2.0"
] | 18 | 2020-10-16T00:38:55.000Z | 2022-03-03T06:01:49.000Z | misc/udp_sender2.py | RyanC1681/RCAI1122 | c9683110b58c255a7a78d880ff73df7ff2329405 | [
"Apache-2.0"
] | 20 | 2020-07-23T03:50:50.000Z | 2021-11-09T04:00:26.000Z | misc/udp_sender2.py | RyanC1681/RCAI1122 | c9683110b58c255a7a78d880ff73df7ff2329405 | [
"Apache-2.0"
] | 140 | 2019-11-20T22:46:02.000Z | 2022-03-29T13:26:17.000Z | import cv2
import numpy as np
import socket
if __name__ == '__main__':
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = 12345
while True:
s.sendto(b'hello world', ("192.168.1.10", 8001))
| 21.9 | 56 | 0.6621 | import cv2
import numpy as np
import socket
if __name__ == '__main__':
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
port = 12345
while True:
s.sendto(b'hello world', ("192.168.1.10", 8001))
| true | true |
f70885a0c1f0e264313599ed4882bcdc4fbd90cc | 6,207 | py | Python | qcfractal/services/service_util.py | dgasmith/QCFractal | 137cb91d4409a1395273239a9df668a314a1914b | [
"BSD-3-Clause"
] | null | null | null | qcfractal/services/service_util.py | dgasmith/QCFractal | 137cb91d4409a1395273239a9df668a314a1914b | [
"BSD-3-Clause"
] | null | null | null | qcfractal/services/service_util.py | dgasmith/QCFractal | 137cb91d4409a1395273239a9df668a314a1914b | [
"BSD-3-Clause"
] | null | null | null | """
Utilities and base functions for Services.
"""
import abc
import datetime
from typing import Any, Dict, List, Optional, Set, Tuple
from pydantic import validator
from qcelemental.models import ComputeError
from ..interface.models import ObjectId, ProtoModel
from ..interface.models.rest_models import TaskQueuePOS... | 28.213636 | 97 | 0.585629 |
import abc
import datetime
from typing import Any, Dict, List, Optional, Set, Tuple
from pydantic import validator
from qcelemental.models import ComputeError
from ..interface.models import ObjectId, ProtoModel
from ..interface.models.rest_models import TaskQueuePOSTBody
from ..interface.models.task_models import Pr... | true | true |
f70887653f4a99c859d4974b9a671614af60f65c | 1,445 | py | Python | nipype/interfaces/fsl/tests/test_auto_ImageMeants.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_ImageMeants.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/fsl/tests/test_auto_ImageMeants.py | grlee77/nipype | 73f3a733ac1b7d9b09ec32a387905a9302423b87 | [
"BSD-3-Clause"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.fsl.utils import ImageMeants
def test_ImageMeants_inputs():
input_map = dict(args=dict(argstr='%s',
),
eig=dict(argstr='--eig',
),
environ=dict(nohash=True,
usedefault=True,
... | 24.913793 | 78 | 0.626298 | from nipype.testing import assert_equal
from nipype.interfaces.fsl.utils import ImageMeants
def test_ImageMeants_inputs():
input_map = dict(args=dict(argstr='%s',
),
eig=dict(argstr='--eig',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash=True,
usedefau... | true | true |
f70888cccef2dea4dc7409027873cec829ecaa0e | 3,682 | py | Python | backend/shopping-cart-service/add_to_cart.py | qingshui-hui/aws-serverless-shopping-cart | 3838c981b02726e1ff7b504f1aa0f99b1ddf9b5a | [
"MIT-0"
] | null | null | null | backend/shopping-cart-service/add_to_cart.py | qingshui-hui/aws-serverless-shopping-cart | 3838c981b02726e1ff7b504f1aa0f99b1ddf9b5a | [
"MIT-0"
] | null | null | null | backend/shopping-cart-service/add_to_cart.py | qingshui-hui/aws-serverless-shopping-cart | 3838c981b02726e1ff7b504f1aa0f99b1ddf9b5a | [
"MIT-0"
] | null | null | null | import json
import os
import boto3
from aws_lambda_powertools import Logger, Metrics, Tracer
from shared import (
NotFoundException,
generate_ttl,
get_cart_id,
get_headers,
get_user_sub,
)
from utils import get_product_from_external_service
logger = Logger()
tracer = Tracer()
metrics = Metrics()
... | 32.017391 | 117 | 0.591798 | import json
import os
import boto3
from aws_lambda_powertools import Logger, Metrics, Tracer
from shared import (
NotFoundException,
generate_ttl,
get_cart_id,
get_headers,
get_user_sub,
)
from utils import get_product_from_external_service
logger = Logger()
tracer = Tracer()
metrics = Metrics()
... | true | true |
f70888fefa0932966b4e0cafeacfa5a514ce37b1 | 13,148 | py | Python | src/config/api-server/vnc_cfg_api_server/tests/resources/test_sync_node_profile.py | Dmitry-Eremeev/contrail-controller | 1238bcff697981662225ec5a15bc4d3d2237ae93 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server/tests/resources/test_sync_node_profile.py | Dmitry-Eremeev/contrail-controller | 1238bcff697981662225ec5a15bc4d3d2237ae93 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server/tests/resources/test_sync_node_profile.py | Dmitry-Eremeev/contrail-controller | 1238bcff697981662225ec5a15bc4d3d2237ae93 | [
"Apache-2.0"
] | null | null | null | import logging
import pprint
from vnc_api.gen.resource_client import Card
from vnc_api.gen.resource_client import Hardware
from vnc_api.gen.resource_client import Node
from vnc_api.gen.resource_client import NodeProfile
from vnc_api.gen.resource_client import Port
from vnc_api.gen.resource_client import Tag
from vnc_a... | 42.688312 | 78 | 0.5054 | import logging
import pprint
from vnc_api.gen.resource_client import Card
from vnc_api.gen.resource_client import Hardware
from vnc_api.gen.resource_client import Node
from vnc_api.gen.resource_client import NodeProfile
from vnc_api.gen.resource_client import Port
from vnc_api.gen.resource_client import Tag
from vnc_a... | true | true |
f70889aa8067984aad29790c5f57f13c36b50ae1 | 8,204 | py | Python | CDAN-GD/pre_process.py | MoriZSJ/GVB | 9b954660ef377ead81c8e631c4a0f4a17075b2ea | [
"MIT"
] | null | null | null | CDAN-GD/pre_process.py | MoriZSJ/GVB | 9b954660ef377ead81c8e631c4a0f4a17075b2ea | [
"MIT"
] | null | null | null | CDAN-GD/pre_process.py | MoriZSJ/GVB | 9b954660ef377ead81c8e631c4a0f4a17075b2ea | [
"MIT"
] | null | null | null | import numpy as np
from torchvision import transforms
import os
from PIL import Image, ImageOps
import numbers
import torch
class ResizeImage():
def __init__(self, size):
if isinstance(size, int):
self.size = (int(size), int(size))
else:
self.size = size
def __call__(s... | 31.43295 | 91 | 0.576548 | import numpy as np
from torchvision import transforms
import os
from PIL import Image, ImageOps
import numbers
import torch
class ResizeImage():
def __init__(self, size):
if isinstance(size, int):
self.size = (int(size), int(size))
else:
self.size = size
def __call__(s... | true | true |
f70889fb73d826435c3a78574b11a432ea63d154 | 17,638 | py | Python | View/cadastro_fornecedor.py | felipezago/ControleEstoque | 229659c4f9888fd01df34375ec92af7a1f734d10 | [
"MIT"
] | null | null | null | View/cadastro_fornecedor.py | felipezago/ControleEstoque | 229659c4f9888fd01df34375ec92af7a1f734d10 | [
"MIT"
] | null | null | null | View/cadastro_fornecedor.py | felipezago/ControleEstoque | 229659c4f9888fd01df34375ec92af7a1f734d10 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'UI/cadastro_fornecedor.ui'
#
# Created by: PyQt5 UI code generator 5.15.4
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 impo... | 43.875622 | 105 | 0.707677 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_ct_FormFornecedor(object):
def setupUi(self, ct_FormFornecedor):
ct_FormFornecedor.setObjectName("ct_FormFornecedor")
ct_FormFornecedor.resize(653, 371)
self.fr_FormFornecedor = QtWidgets.QFrame(ct_FormFornecedor)
self.fr_FormF... | true | true |
f7088ab28b5d544214f4b2534e46dd9c09bd6fea | 3,830 | py | Python | code/cmoa-img-desc-parallel/scraper.py | CreativeInquiry/TeenieHarrisProject | c7c2e1730ade29ed086a4bd21d5d21315fcde5e5 | [
"MIT"
] | null | null | null | code/cmoa-img-desc-parallel/scraper.py | CreativeInquiry/TeenieHarrisProject | c7c2e1730ade29ed086a4bd21d5d21315fcde5e5 | [
"MIT"
] | 9 | 2019-03-27T18:42:41.000Z | 2019-03-31T17:04:24.000Z | code/cmoa-img-desc-parallel/scraper.py | CreativeInquiry/TeenieHarrisProject | c7c2e1730ade29ed086a4bd21d5d21315fcde5e5 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
import os
import sys
from glob import glob
import re
import json
import random
import shutil
import re
import codecs
dones = [x for x in open("done.txt",'r').read().split("\n... | 33.893805 | 129 | 0.6047 | from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
import time
import os
import sys
from glob import glob
import re
import json
import random
import shutil
import re
import codecs
dones = [x for x in open("done.txt",'r').read().split("\n... | true | true |
f7088b733943ec4deaa0fa6c680bb6105d440e68 | 2,151 | py | Python | src/automotive/core/can/tools/reader/usb_can_reader.py | philosophy912/automotive | de918611652b789a83545f346c1569c2c2c955a6 | [
"Apache-2.0"
] | null | null | null | src/automotive/core/can/tools/reader/usb_can_reader.py | philosophy912/automotive | de918611652b789a83545f346c1569c2c2c955a6 | [
"Apache-2.0"
] | null | null | null | src/automotive/core/can/tools/reader/usb_can_reader.py | philosophy912/automotive | de918611652b789a83545f346c1569c2c2c955a6 | [
"Apache-2.0"
] | 1 | 2022-02-28T07:23:28.000Z | 2022-02-28T07:23:28.000Z | # -*- coding:utf-8 -*-
# --------------------------------------------------------
# Copyright (C), 2016-2020, lizhe, All rights reserved
# --------------------------------------------------------
# @Name: usb_can_reader.py
# @Author: lizhe
# @Created: 2021/5/1 - 23:45
# ---------------------------------... | 35.85 | 105 | 0.535565 | import re
from typing import List, Tuple
from automotive.core.can.message import Message
from .trace_reader import TraceReader
from automotive.logger.logger import logger
class UsbCanReader(TraceReader):
def read(self, file: str) -> List[Tuple[float, Message]]:
contents = self.__filter_content(file)
... | true | true |
f7088bd373aef47e9887dc1b0e5be23ea3cb543e | 190 | py | Python | premium/backend/src/baserow_premium/api/urls.py | cjh0613/baserow | 62871f5bf53c9d25446976031aacb706c0abe584 | [
"MIT"
] | null | null | null | premium/backend/src/baserow_premium/api/urls.py | cjh0613/baserow | 62871f5bf53c9d25446976031aacb706c0abe584 | [
"MIT"
] | null | null | null | premium/backend/src/baserow_premium/api/urls.py | cjh0613/baserow | 62871f5bf53c9d25446976031aacb706c0abe584 | [
"MIT"
] | null | null | null | from django.urls import path, include
from .admin import urls as admin_urls
app_name = "baserow_premium.api"
urlpatterns = [
path("admin/", include(admin_urls, namespace="admin")),
]
| 19 | 59 | 0.731579 | from django.urls import path, include
from .admin import urls as admin_urls
app_name = "baserow_premium.api"
urlpatterns = [
path("admin/", include(admin_urls, namespace="admin")),
]
| true | true |
f7088bdebaf4c3ef67a5162ba9bd81693a179b45 | 1,619 | py | Python | octoprint_codemods/yield_from_generator.py | OctoPrint/codemods | 6c6cd4bd689582f906571951b0eb7729c4923b51 | [
"MIT"
] | 5 | 2020-10-06T12:02:23.000Z | 2021-04-26T00:31:55.000Z | octoprint_codemods/yield_from_generator.py | OctoPrint/codemods | 6c6cd4bd689582f906571951b0eb7729c4923b51 | [
"MIT"
] | null | null | null | octoprint_codemods/yield_from_generator.py | OctoPrint/codemods | 6c6cd4bd689582f906571951b0eb7729c4923b51 | [
"MIT"
] | 1 | 2020-10-10T17:18:39.000Z | 2020-10-10T17:18:39.000Z | from typing import Union, cast
import libcst as cst
import libcst.matchers as m
from .util import CodeMod, runner
"""
libcst based transformer to convert 'for x in generator: yield x' to 'yield from generator'.
"""
__author__ = "Gina Häußge <gina@octoprint.org>"
__license__ = "MIT"
class YieldFromGenerator(CodeMo... | 29.436364 | 92 | 0.579988 | from typing import Union, cast
import libcst as cst
import libcst.matchers as m
from .util import CodeMod, runner
__author__ = "Gina Häußge <gina@octoprint.org>"
__license__ = "MIT"
class YieldFromGenerator(CodeMod):
DESCRIPTION: str = "Converts 'for x in generator: yield x' to 'yield from generator'."
d... | true | true |
f7088c087cad60100e39ebb04ca112f5066abe65 | 11,764 | py | Python | google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/base.py | Nawod/python-aiplatform | ffc70d148868489161797cc25a63298dda322d5f | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/base.py | Nawod/python-aiplatform | ffc70d148868489161797cc25a63298dda322d5f | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1beta1/services/pipeline_service/transports/base.py | Nawod/python-aiplatform | ffc70d148868489161797cc25a63298dda322d5f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.11041 | 103 | 0.663125 | import abc
from typing import Awaitable, Callable, Dict, Optional, Sequence, Union
import packaging.version
import pkg_resources
import google.auth import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries fro... | true | true |
f7088c22019381ab4d1c04624a2767d334cb277b | 1,111 | py | Python | PythonBaseDemo/ModulesAndPackages/9.1/import_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/ModulesAndPackages/9.1/import_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | PythonBaseDemo/ModulesAndPackages/9.1/import_test.py | CypHelp/TestNewWorldDemo | ee6f73df05756f191c1c56250fa290461fdd1b9a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#########################################################################
# 网站: <a href="http://www.crazyit.org">疯狂Java联盟</a> #
# author yeeku.H.lee kongyeeku@163.com #
# #
# version 1.0 ... | 58.473684 | 73 | 0.193519 | import sys
print(sys.argv[0]) | true | true |
f7088c63313f91b709e1ed0c583841d1f3be3c28 | 92,660 | py | Python | tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | Halimaz/tensorflow-1 | 3437fba39d5bca77fd7627aad15ba76fb75f5731 | [
"Apache-2.0"
] | 1 | 2018-08-15T10:03:38.000Z | 2018-08-15T10:03:38.000Z | tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | Halimaz/tensorflow-1 | 3437fba39d5bca77fd7627aad15ba76fb75f5731 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/rnn/python/kernel_tests/core_rnn_test.py | Halimaz/tensorflow-1 | 3437fba39d5bca77fd7627aad15ba76fb75f5731 | [
"Apache-2.0"
] | null | null | null | # 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... | 37.897751 | 85 | 0.657555 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import itertools
import numpy as np
from six.moves import xrange
from tensorflow.contrib import rnn as rnn_lib
from tensorflow.core.protobuf import config_pb2
from tensorflow.python.eager import context
fro... | true | true |
f7088d12531d2cc76918d77327731449d698a09b | 2,304 | py | Python | tests/test_run.py | hfchong/dvc | 2e3ce3b3dbb02f6524b0383e3f599c4561413634 | [
"Apache-2.0"
] | null | null | null | tests/test_run.py | hfchong/dvc | 2e3ce3b3dbb02f6524b0383e3f599c4561413634 | [
"Apache-2.0"
] | null | null | null | tests/test_run.py | hfchong/dvc | 2e3ce3b3dbb02f6524b0383e3f599c4561413634 | [
"Apache-2.0"
] | null | null | null | import os
import filecmp
from dvc.main import main
from dvc.utils import file_md5
from dvc.stage import Stage
from dvc.command.run import CmdRun
from tests.basic_env import TestDvc
class TestRun(TestDvc):
def test(self):
cmd = 'python {} {} {}'.format(self.CODE, self.FOO, 'out')
deps = [self.FOO... | 31.561644 | 78 | 0.523438 | import os
import filecmp
from dvc.main import main
from dvc.utils import file_md5
from dvc.stage import Stage
from dvc.command.run import CmdRun
from tests.basic_env import TestDvc
class TestRun(TestDvc):
def test(self):
cmd = 'python {} {} {}'.format(self.CODE, self.FOO, 'out')
deps = [self.FOO... | true | true |
f7088d26d6e642b7dffd25f3df9157dad7084972 | 8,462 | py | Python | airflow/providers/cncf/kubernetes/hooks/kubernetes.py | omad/airflow | 663259d4b541ab10ce55fec4d2460e23917062c2 | [
"Apache-2.0"
] | 1 | 2021-07-07T15:13:51.000Z | 2021-07-07T15:13:51.000Z | airflow/providers/cncf/kubernetes/hooks/kubernetes.py | omad/airflow | 663259d4b541ab10ce55fec4d2460e23917062c2 | [
"Apache-2.0"
] | 1 | 2020-10-15T22:39:05.000Z | 2020-10-15T22:39:05.000Z | airflow/providers/cncf/kubernetes/hooks/kubernetes.py | tanjinP/airflow | f0b9aae564805fb09328faf0c47f441ee0699ed8 | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 37.608889 | 110 | 0.650201 | import tempfile
from typing import Any, Generator, Optional, Tuple, Union
import yaml
from cached_property import cached_property
from kubernetes import client, config, watch
from airflow.exceptions import AirflowException
from airflow.hooks.base_hook import BaseHook
def _load_body_to_dict(body):
try:
b... | true | true |
f7088d8ddc8d7584686f5d81c7a2b9b5233b813c | 128 | py | Python | src/init.py | HofmannCh/PythonSnake | e737414f1e9150bdd22d6267a53e25b85f3b5ccc | [
"MIT"
] | null | null | null | src/init.py | HofmannCh/PythonSnake | e737414f1e9150bdd22d6267a53e25b85f3b5ccc | [
"MIT"
] | null | null | null | src/init.py | HofmannCh/PythonSnake | e737414f1e9150bdd22d6267a53e25b85f3b5ccc | [
"MIT"
] | null | null | null | from Window import Window
from Logic import Logic
print("Init")
logic = Logic()
win = Window(logic)
win.mainloop()
print("End") | 16 | 25 | 0.734375 | from Window import Window
from Logic import Logic
print("Init")
logic = Logic()
win = Window(logic)
win.mainloop()
print("End") | true | true |
f7088ed2ed08b3c8c7ac9ec0bca022ea7e57a025 | 735 | py | Python | students/K33422/Iskhakova_Emina/labs/lab1/task2_server.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 498a6138e352e7e0ca40d1eb301bc29416158f51 | [
"MIT"
] | null | null | null | students/K33422/Iskhakova_Emina/labs/lab1/task2_server.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 498a6138e352e7e0ca40d1eb301bc29416158f51 | [
"MIT"
] | null | null | null | students/K33422/Iskhakova_Emina/labs/lab1/task2_server.py | emina13/ITMO_ICT_WebDevelopment_2021-2022 | 498a6138e352e7e0ca40d1eb301bc29416158f51 | [
"MIT"
] | null | null | null | import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('localhost', 8080))
sock.listen(1)
clientsoc, addr = sock.accept()
print('connected:', addr)
message = ''
while True:
clientsoc.sendall(bytes(message + f'Enter two bases and its hight or "exit" to finish the program', "u... | 27.222222 | 114 | 0.560544 | import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('localhost', 8080))
sock.listen(1)
clientsoc, addr = sock.accept()
print('connected:', addr)
message = ''
while True:
clientsoc.sendall(bytes(message + f'Enter two bases and its hight or "exit" to finish the program', "u... | true | true |
f708911d8933c643cca11ef42a3909ff1dc435e3 | 595 | py | Python | angr/procedures/libc/fscanf.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 2 | 2020-04-29T02:39:42.000Z | 2020-04-29T08:07:44.000Z | angr/procedures/libc/fscanf.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | null | null | null | angr/procedures/libc/fscanf.py | Kyle-Kyle/angr | 345b2131a7a67e3a6ffc7d9fd475146a3e12f837 | [
"BSD-2-Clause"
] | 3 | 2019-10-17T07:47:36.000Z | 2022-01-24T23:38:13.000Z | from angr.procedures.stubs.format_parser import FormatParser
from cle.backends.externs.simdata.io_file import io_file_data_for_arch
class fscanf(FormatParser):
#pylint:disable=arguments-differ
def run(self, file_ptr):
# TODO handle errors
fd_offset = io_file_data_for_arch(self.state.arch)['f... | 29.75 | 70 | 0.678992 | from angr.procedures.stubs.format_parser import FormatParser
from cle.backends.externs.simdata.io_file import io_file_data_for_arch
class fscanf(FormatParser):
def run(self, file_ptr):
fd_offset = io_file_data_for_arch(self.state.arch)['fd']
fd = self.state.mem[file_ptr + fd_offset:]... | true | true |
f708920170b2d6285358225fb37557f4b233ef57 | 5,448 | py | Python | gomatic/gocd/artifacts.py | ayr-ton/gomatic | 314d0bed56888f44326f15ca6b2da20e7909cf67 | [
"MIT"
] | 96 | 2015-01-06T22:08:29.000Z | 2017-06-01T08:14:11.000Z | gomatic/gocd/artifacts.py | ayr-ton/gomatic | 314d0bed56888f44326f15ca6b2da20e7909cf67 | [
"MIT"
] | 50 | 2017-06-10T20:10:12.000Z | 2021-12-21T15:41:25.000Z | gomatic/gocd/artifacts.py | ayr-ton/gomatic | 314d0bed56888f44326f15ca6b2da20e7909cf67 | [
"MIT"
] | 39 | 2017-06-10T20:06:16.000Z | 2021-10-30T14:18:09.000Z | from xml.etree import ElementTree as ET
from gomatic.mixins import CommonEqualityMixin
def fetch_artifact_src_from(element):
if 'srcfile' in element.attrib:
return FetchArtifactFile(element.attrib['srcfile'])
if 'srcdir' in element.attrib:
return FetchArtifactDir(element.attrib['srcdir'])
... | 41.587786 | 202 | 0.643172 | from xml.etree import ElementTree as ET
from gomatic.mixins import CommonEqualityMixin
def fetch_artifact_src_from(element):
if 'srcfile' in element.attrib:
return FetchArtifactFile(element.attrib['srcfile'])
if 'srcdir' in element.attrib:
return FetchArtifactDir(element.attrib['srcdir'])
... | true | true |
f7089239c29071e4fcbee245e9912b787606573e | 6,882 | py | Python | multiphonon/ui/getdos0.py | granrothge/multiphonon | 486a998eeb6b73b964a58ba0f98fe3ece15bdf6e | [
"MIT"
] | 1 | 2019-05-22T08:46:09.000Z | 2019-05-22T08:46:09.000Z | multiphonon/ui/getdos0.py | granrothge/multiphonon | 486a998eeb6b73b964a58ba0f98fe3ece15bdf6e | [
"MIT"
] | 118 | 2016-04-04T12:27:15.000Z | 2021-08-18T01:46:13.000Z | multiphonon/ui/getdos0.py | granrothge/multiphonon | 486a998eeb6b73b964a58ba0f98fe3ece15bdf6e | [
"MIT"
] | 5 | 2017-09-28T16:01:12.000Z | 2020-01-31T18:58:09.000Z |
def notebookUI(samplenxs, mtnxs, initdos=None, options=None, load_options_path=None):
import yaml
if options is not None and load_options_path:
raise RuntimeError(
"Both options and load_options_path were set: %s, %s" %(
options, load_options_path)
)
if load_opti... | 39.102273 | 144 | 0.622784 |
def notebookUI(samplenxs, mtnxs, initdos=None, options=None, load_options_path=None):
import yaml
if options is not None and load_options_path:
raise RuntimeError(
"Both options and load_options_path were set: %s, %s" %(
options, load_options_path)
)
if load_opti... | true | true |
f708928e9cd5afabafcf6b37d400298162bd755f | 15,941 | py | Python | mars/dataframe/base/drop.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/dataframe/base/drop.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/dataframe/base/drop.py | hxri/mars | f7864f00911883b94800b63856f0e57648d3d9b4 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.93595 | 111 | 0.56753 |
import warnings
from collections import OrderedDict
import numpy as np
from ... import opcodes
from ...core import Entity, Chunk, CHUNK_TYPE, OutputType, recursive_tile
from ...serialization.serializables import AnyField, StringField
from ..core import IndexValue, DATAFRAME_TYPE, SERIES_TYPE, INDEX_CHUNK_TYPE
from .... | true | true |
f70892be43edd841758689d19686bf38cf8dd5a0 | 626 | py | Python | app/data.py | tjdaley/publicdataws | 1aa4a98cf47fae10cc0f59a8d01168df806b4919 | [
"MIT"
] | null | null | null | app/data.py | tjdaley/publicdataws | 1aa4a98cf47fae10cc0f59a8d01168df806b4919 | [
"MIT"
] | null | null | null | app/data.py | tjdaley/publicdataws | 1aa4a98cf47fae10cc0f59a8d01168df806b4919 | [
"MIT"
] | null | null | null | def Articles():
return [
{
'id': 1,
'title': 'Article 1',
'body': 'Body of first article',
'author': 'Tom Daley',
'create_date': '07-28-2019'
},
{
'id': 2,
'title': 'Article 2',
'body': 'Body of s... | 26.083333 | 45 | 0.375399 | def Articles():
return [
{
'id': 1,
'title': 'Article 1',
'body': 'Body of first article',
'author': 'Tom Daley',
'create_date': '07-28-2019'
},
{
'id': 2,
'title': 'Article 2',
'body': 'Body of s... | true | true |
f70895bc8cf25fe899a820773083413febdc7000 | 1,033 | py | Python | SidToS3/aws/s3.py | brian-nelson/SupersidUtilities | 0bdd24dc424d7b67d6a72de575487a31f0cb4565 | [
"MIT"
] | null | null | null | SidToS3/aws/s3.py | brian-nelson/SupersidUtilities | 0bdd24dc424d7b67d6a72de575487a31f0cb4565 | [
"MIT"
] | null | null | null | SidToS3/aws/s3.py | brian-nelson/SupersidUtilities | 0bdd24dc424d7b67d6a72de575487a31f0cb4565 | [
"MIT"
] | null | null | null | import boto3
import botocore
class S3:
def __init__(self, key, secret, bucket):
self.Key = key
self.Secret = secret
self.Bucket = bucket
return
def upload_file(self, local_file, remote_file):
s3 = boto3.resource(
's3',
aws_access_key_id=self.Ke... | 25.195122 | 73 | 0.560503 | import boto3
import botocore
class S3:
def __init__(self, key, secret, bucket):
self.Key = key
self.Secret = secret
self.Bucket = bucket
return
def upload_file(self, local_file, remote_file):
s3 = boto3.resource(
's3',
aws_access_key_id=self.Ke... | true | true |
f70895bfda8c4b1ae18bdbfc9932d3a9e1ad00b9 | 11,278 | py | Python | var/spack/repos/builtin/packages/octave/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/octave/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/octave/package.py | alkino/spack | b87ff60c7e23d7b50fac620ad60c8e2537312ebd | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os.path
import shutil
import sys
import tempfile
import spack.util.environment
class Octave(AutotoolsPackage, GNU... | 39.57193 | 95 | 0.582373 | import os.path
import shutil
import sys
import tempfile
import spack.util.environment
class Octave(AutotoolsPackage, GNUMirrorPackage):
homepage = "https://www.gnu.org/software/octave/"
gnu_mirror_path = "octave/octave-4.0.0.tar.gz"
maintainers = ['mtmiller']
extendable = True
version('5.1.0',... | true | true |
f708960fdb8e9cb12cb0f17da5644933690a1490 | 395 | py | Python | travellog/wsgi.py | jacobian/django-travellog | 1712cbeebb8ccceb620757ada3927c545793b7b8 | [
"BSD-3-Clause"
] | 9 | 2018-04-17T18:39:47.000Z | 2021-08-18T06:27:57.000Z | travellog/wsgi.py | jacobian/django-travellog | 1712cbeebb8ccceb620757ada3927c545793b7b8 | [
"BSD-3-Clause"
] | null | null | null | travellog/wsgi.py | jacobian/django-travellog | 1712cbeebb8ccceb620757ada3927c545793b7b8 | [
"BSD-3-Clause"
] | null | null | null | """
WSGI config for travellog project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | 23.235294 | 78 | 0.787342 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "travellog.settings")
application = get_wsgi_application()
| true | true |
f70896259323c12a6a8a8989b79dfbdb5e1f2dfa | 1,080 | py | Python | libp2p/network/stream/net_stream.py | ChihChengLiang/py-libp2p | f0046fa3e0952b492837a698b1988e05c9821f47 | [
"Apache-2.0",
"MIT"
] | null | null | null | libp2p/network/stream/net_stream.py | ChihChengLiang/py-libp2p | f0046fa3e0952b492837a698b1988e05c9821f47 | [
"Apache-2.0",
"MIT"
] | null | null | null | libp2p/network/stream/net_stream.py | ChihChengLiang/py-libp2p | f0046fa3e0952b492837a698b1988e05c9821f47 | [
"Apache-2.0",
"MIT"
] | null | null | null | from .net_stream_interface import INetStream
class NetStream(INetStream):
def __init__(self, muxed_stream):
self.muxed_stream = muxed_stream
self.mplex_conn = muxed_stream.mplex_conn
self.protocol_id = None
def get_protocol(self):
"""
:return: protocol id that stream ... | 24 | 59 | 0.587963 | from .net_stream_interface import INetStream
class NetStream(INetStream):
def __init__(self, muxed_stream):
self.muxed_stream = muxed_stream
self.mplex_conn = muxed_stream.mplex_conn
self.protocol_id = None
def get_protocol(self):
return self.protocol_id
def set_protocol... | true | true |
f70897147c867957abfe46861db62aa36828a286 | 5,274 | py | Python | pandas/tests/indexing/common.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-05-07T04:58:36.000Z | 2021-05-07T04:58:59.000Z | pandas/tests/indexing/common.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexing/common.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-06-16T07:19:12.000Z | 2021-12-16T10:24:44.000Z | """ common utilities """
import itertools
import numpy as np
from pandas import (
DataFrame,
Float64Index,
MultiIndex,
Series,
UInt64Index,
date_range,
)
import pandas._testing as tm
def _mklbl(prefix, n):
return [f"{prefix}{i}" for i in range(n)]
def _axify(obj, key, axis):
# crea... | 27.904762 | 88 | 0.520288 | import itertools
import numpy as np
from pandas import (
DataFrame,
Float64Index,
MultiIndex,
Series,
UInt64Index,
date_range,
)
import pandas._testing as tm
def _mklbl(prefix, n):
return [f"{prefix}{i}" for i in range(n)]
def _axify(obj, key, axis):
axes = [slice(None)] * obj.... | true | true |
f7089727ab760f80d066223b4144c1a11e79522c | 763 | py | Python | recipes/Python/65251_Calculating_Apache_hits_per_IP/recipe-65251.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/65251_Calculating_Apache_hits_per_IP/recipe-65251.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/65251_Calculating_Apache_hits_per_IP/recipe-65251.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | def CalculateApacheIpHits(logfile_pathname):
# make a dictionary to store Ip's and their hit counts and read the
# contents of the logfile line by line
IpHitListing = {}
Contents = open(logfile_pathname, "r").readlines()
# go through each line of the logfile
for line in Contents:
#spli... | 30.52 | 84 | 0.656619 | def CalculateApacheIpHits(logfile_pathname):
# contents of the logfile line by line
IpHitListing = {}
Contents = open(logfile_pathname, "r").readlines()
# go through each line of the logfile
for line in Contents:
#split the string to isolate the ip
Ip = line.split(" ")[... | false | true |
f708974711d14541ae6b980973337a70daf55ace | 420 | py | Python | website/example_problem_graders/simpleai.py | pshen24/cmimc-online | 7d2435e506381fa19f3512635eb615f7a02e5f03 | [
"MIT"
] | null | null | null | website/example_problem_graders/simpleai.py | pshen24/cmimc-online | 7d2435e506381fa19f3512635eb615f7a02e5f03 | [
"MIT"
] | null | null | null | website/example_problem_graders/simpleai.py | pshen24/cmimc-online | 7d2435e506381fa19f3512635eb615f7a02e5f03 | [
"MIT"
] | null | null | null | from .base import BaseGrader
class SimpleAI(BaseGrader):
def grade(self, submission, score):
try:
points = int(submission.text)
except ValueError:
points = 0
submission.points = points
submission.is_graded = True
submission.save()
... | 24.705882 | 51 | 0.585714 | from .base import BaseGrader
class SimpleAI(BaseGrader):
def grade(self, submission, score):
try:
points = int(submission.text)
except ValueError:
points = 0
submission.points = points
submission.is_graded = True
submission.save()
... | true | true |
f70897b4f50c3d304da65ac9f86af36b1c7be865 | 2,183 | py | Python | Examples/SHMExample.py | vd1371/GIAMS | dd6551f344b8d0377131d4496846eb5d03b6189c | [
"MIT"
] | null | null | null | Examples/SHMExample.py | vd1371/GIAMS | dd6551f344b8d0377131d4496846eb5d03b6189c | [
"MIT"
] | null | null | null | Examples/SHMExample.py | vd1371/GIAMS | dd6551f344b8d0377131d4496846eb5d03b6189c | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------- #
# This example was designed to show the project-level optimization
# option in GIAMS. This example was used in the original paper as well
# -------------------------------------------------------------------- #
import time
import ast
from Netwo... | 23.223404 | 86 | 0.674301 |
import time
import ast
from Network import IndianaNetwork
from LifeCycleAnalyzer.Simulators import MainSimulator
from LifeCycleAnalyzer import LCA
from Optimizer import HillClimbing
from Optimizer import BruteForce
from Optimizer import GA
from Optimizer import IUC
from Optimizer import PSO
from utils.PredictiveMo... | true | true |
f70897f9eb8aeca2cd474fecd27ec7d2df2c1157 | 5,421 | py | Python | addons/stock_dropshipping/tests/test_dropship.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/stock_dropshipping/tests/test_dropship.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | addons/stock_dropshipping/tests/test_dropship.py | jjiege/odoo | fd5b8ad387c1881f349d125cbd56433f4d49398f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.tests import common, Form
from odoo.tools import mute_logger
class TestDropship(common.TransactionCase):
def test_change_qty(self):
# enable the dropship and MTO route on the product
prod ... | 43.717742 | 112 | 0.611695 |
from odoo.tests import common, Form
from odoo.tools import mute_logger
class TestDropship(common.TransactionCase):
def test_change_qty(self):
prod = self.env.ref('product.product_product_8')
dropshipping_route = self.env.ref('stock_dropshipping.route_drop_shipping')
mto_route = se... | true | true |
f7089a3189e9200c44cfa339fb72e02b96aba0ef | 241 | py | Python | imagr_site/urls.py | cewing/cfpydev-imagr | 423ec9d9b38be990ab7dca027877e1c12f3d07fe | [
"MIT"
] | null | null | null | imagr_site/urls.py | cewing/cfpydev-imagr | 423ec9d9b38be990ab7dca027877e1c12f3d07fe | [
"MIT"
] | null | null | null | imagr_site/urls.py | cewing/cfpydev-imagr | 423ec9d9b38be990ab7dca027877e1c12f3d07fe | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('imagr_users.urls'))
)
| 21.909091 | 51 | 0.701245 | from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
url(r'^admin/', include(admin.site.urls)),
url(r'^accounts/', include('imagr_users.urls'))
)
| true | true |
f7089a89f944e9cd852c6eb3d6019ff7857667e6 | 12,486 | py | Python | .history/implementations/pixelda/pixelda_20190101201505.py | Napkin-DL/PyTorch-GAN | 4668fb434a74a4e4771631944e4abfb0ec1c8795 | [
"MIT"
] | null | null | null | .history/implementations/pixelda/pixelda_20190101201505.py | Napkin-DL/PyTorch-GAN | 4668fb434a74a4e4771631944e4abfb0ec1c8795 | [
"MIT"
] | null | null | null | .history/implementations/pixelda/pixelda_20190101201505.py | Napkin-DL/PyTorch-GAN | 4668fb434a74a4e4771631944e4abfb0ec1c8795 | [
"MIT"
] | null | null | null | import argparse
import os
import numpy as np
import math
import itertools
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
from mnistm import MNISTM
import torch.nn as nn
... | 37.271642 | 129 | 0.610764 | import argparse
import os
import numpy as np
import math
import itertools
import torchvision.transforms as transforms
from torchvision.utils import save_image
from torch.utils.data import DataLoader
from torchvision import datasets
from torch.autograd import Variable
from mnistm import MNISTM
import torch.nn as nn
... | true | true |
f7089a96ae5c3cce139ef55f845870056c30ebb7 | 2,551 | py | Python | midca/modules/_goalgen/goalinsert.py | Heider1632/midca | ff61e1b291ae9a3aa784c75b4069f91884e26b2c | [
"MIT"
] | null | null | null | midca/modules/_goalgen/goalinsert.py | Heider1632/midca | ff61e1b291ae9a3aa784c75b4069f91884e26b2c | [
"MIT"
] | null | null | null | midca/modules/_goalgen/goalinsert.py | Heider1632/midca | ff61e1b291ae9a3aa784c75b4069f91884e26b2c | [
"MIT"
] | null | null | null |
from goalgen import *
class NewGuide:
def __init__(self, useTFBase, useTFFire, catchArsonist, useMA, prioritizeNew):
self.tfBase = useTFBase
self.tfFire = useTFFire
self.catchArsonist = catchArsonist
self.useMA = useMA
self.prioritizeNew = prioritizeNew
self.step = 0
def init(self, world, mem, memKe... | 28.662921 | 79 | 0.682869 |
from goalgen import *
class NewGuide:
def __init__(self, useTFBase, useTFFire, catchArsonist, useMA, prioritizeNew):
self.tfBase = useTFBase
self.tfFire = useTFFire
self.catchArsonist = catchArsonist
self.useMA = useMA
self.prioritizeNew = prioritizeNew
self.step = 0
def init(self, world, mem, memKe... | false | true |
f7089ba093dc0bbb1c054cb1d3da1322b5b180f0 | 346 | py | Python | plotting-beginner-plotting-cookbook/pltcp.py | hrayatnia/SciPy | a50dcbb6b8adffbc526eec93f5009f09943786e3 | [
"BSD-3-Clause"
] | null | null | null | plotting-beginner-plotting-cookbook/pltcp.py | hrayatnia/SciPy | a50dcbb6b8adffbc526eec93f5009f09943786e3 | [
"BSD-3-Clause"
] | null | null | null | plotting-beginner-plotting-cookbook/pltcp.py | hrayatnia/SciPy | a50dcbb6b8adffbc526eec93f5009f09943786e3 | [
"BSD-3-Clause"
] | 1 | 2021-08-14T23:05:03.000Z | 2021-08-14T23:05:03.000Z | import numpy as np
import matplotlib.patches as patches
import matplotlib.pyplot as plt
ax = plt.axes(polar = True)
theta = np.linspace(0, 2 * np.pi, 8, endpoint = False)
radius = .25 + .75 * np.random.random(size = len(theta))
points = np.vstack((theta, radius)).transpose()
plt.gca().add_patch(patches.Polygon(points, ... | 38.444444 | 59 | 0.710983 | import numpy as np
import matplotlib.patches as patches
import matplotlib.pyplot as plt
ax = plt.axes(polar = True)
theta = np.linspace(0, 2 * np.pi, 8, endpoint = False)
radius = .25 + .75 * np.random.random(size = len(theta))
points = np.vstack((theta, radius)).transpose()
plt.gca().add_patch(patches.Polygon(points, ... | true | true |
f7089c9da38300abd4358f58c0aaa203dffd7c0e | 710 | py | Python | weatherterm/core/parser_loader.py | eustone/weather-app | 06b85178cf9e8a195c69d3622af73cc2d15ed7a8 | [
"MIT"
] | null | null | null | weatherterm/core/parser_loader.py | eustone/weather-app | 06b85178cf9e8a195c69d3622af73cc2d15ed7a8 | [
"MIT"
] | null | null | null | weatherterm/core/parser_loader.py | eustone/weather-app | 06b85178cf9e8a195c69d3622af73cc2d15ed7a8 | [
"MIT"
] | null | null | null | import os
import re
import inspect
def _get_parser_list(dirname):
files = [ f.replace('.py','') for f in os.listdir(dirname) if not f.startswith('__')
]
return files
def _import_parsers(parserfiles):
m = re.compile('.+parsers',re.I)
_modules = __import__('weatherterm.parsers',globals(),locals(),pa... | 32.272727 | 100 | 0.690141 | import os
import re
import inspect
def _get_parser_list(dirname):
files = [ f.replace('.py','') for f in os.listdir(dirname) if not f.startswith('__')
]
return files
def _import_parsers(parserfiles):
m = re.compile('.+parsers',re.I)
_modules = __import__('weatherterm.parsers',globals(),locals(),pa... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.