hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c39415d2831c402bbcfd6fc9987ca728401fb5c | 333,094 | py | Python | packages/vaex-core/vaex/dataframe.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 337 | 2016-02-11T07:36:35.000Z | 2018-12-10T07:17:35.000Z | packages/vaex-core/vaex/dataframe.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 127 | 2016-07-06T15:43:14.000Z | 2018-12-11T18:46:27.000Z | packages/vaex-core/vaex/dataframe.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 29 | 2016-10-05T14:15:28.000Z | 2018-11-29T10:17:00.000Z | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import io
import difflib
import base64
from typing import Iterable
import os
import math
import time
import itertools
import functools
import collections
import sys
import platform
import warnings
import re
from functools import reduce
import threa... | 45.887037 | 307 | 0.595706 |
1c39458530ceec542f15fe8ab7a396f63b750c45 | 1,210 | py | Python | bootcamp/wiki/plugins/links/wiki_plugin.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/plugins/links/wiki_plugin.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | bootcamp/wiki/plugins/links/wiki_plugin.py | basiltiger/easy_bootcamp | 875b9ed287f1a7824bb38f142dbe2f3b1ce54389 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.core.urlresolvers import reverse_lazy
from django.utils.translation import ugettext as _
from wiki.core.plugins import registry
from wiki.core.plugins.base import BasePlugin
from wiki.plugins.links import setti... | 30.25 | 79 | 0.673554 |
1c39477d259e9ad716d99cbf82e58e6f3b87381e | 2,399 | py | Python | clif/testing/python/sequence_methods_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/sequence_methods_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | clif/testing/python/sequence_methods_test.py | timgates42/clif | b865c88beff70b31068889926d1184d5ddc0b9eb | [
"Apache-2.0"
] | null | null | null | # 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 agreed to in writing, ... | 33.788732 | 74 | 0.689037 |
1c39d2ce35fa1d037a4d280d7d6f300feb05c36a | 23,359 | py | Python | armi/bookkeeping/memoryProfiler.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/bookkeeping/memoryProfiler.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | armi/bookkeeping/memoryProfiler.py | bsculac/armi | 22399244a88e67fc09996981081f7d5aab7032b4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writi... | 35.179217 | 115 | 0.593176 |
1c39ee4c86ec9922e58fdf773cb6aa7bd3757d51 | 26 | py | Python | btd6_memory_info/generated/UnityEngine/PlayerLoop/Initialization/initialization.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/PlayerLoop/Initialization/initialization.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/UnityEngine/PlayerLoop/Initialization/initialization.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class Initialization: pass | 26 | 26 | 0.884615 |
1c3a14d0e4d9b473800a1641dd453ca9f025be9b | 8,014 | py | Python | mobiletrans/mtdistmap/utils/generate_tiles.py | JoeJasinski/WindyTransit | b883c7eebe618923ecc7b1914a696543d8864215 | [
"MIT"
] | 1 | 2015-04-28T14:48:27.000Z | 2015-04-28T14:48:27.000Z | mobiletrans/mtdistmap/utils/generate_tiles.py | JoeJasinski/WindyTransit | b883c7eebe618923ecc7b1914a696543d8864215 | [
"MIT"
] | null | null | null | mobiletrans/mtdistmap/utils/generate_tiles.py | JoeJasinski/WindyTransit | b883c7eebe618923ecc7b1914a696543d8864215 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#Source: https://trac.openstreetmap.org/browser/subversion/applications/rendering/mapnik/generate_tiles.py
from math import pi,cos,sin,log,exp,atan
from subprocess import call
import sys, os
from Queue import Queue
import threading
try:
import mapnik2 as mapnik
except:
import mapnik
D... | 30.942085 | 123 | 0.552284 |
1c3a28f92384c0424932cd1830d82b370022b30a | 33,531 | py | Python | salt/modules/network.py | rfairburn/salt | 7e44444e873e1cb1d2fe13e39b0edea3779a2b5e | [
"Apache-2.0"
] | 2 | 2015-08-04T21:54:38.000Z | 2019-04-25T21:47:08.000Z | salt/modules/network.py | rfairburn/salt | 7e44444e873e1cb1d2fe13e39b0edea3779a2b5e | [
"Apache-2.0"
] | null | null | null | salt/modules/network.py | rfairburn/salt | 7e44444e873e1cb1d2fe13e39b0edea3779a2b5e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Module for gathering and managing network information
'''
# Import python libs
from __future__ import absolute_import
import datetime
import hashlib
import logging
import re
import os
import socket
# Import salt libs
import salt.utils
import salt.utils.decorators as decorators
import salt.... | 28.082915 | 126 | 0.550028 |
1c3a4a557a20261febd8cee212907d3137fcfe6a | 25,108 | py | Python | salt/states/lxc.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/states/lxc.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/states/lxc.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage Linux Containers
=======================
'''
from __future__ import absolute_import
__docformat__ = 'restructuredtext en'
# Import salt libs
import salt.utils
from salt.exceptions import CommandExecutionError, SaltInvocationError
# Container existence/non-existence
def present(nam... | 32.692708 | 79 | 0.516329 |
1c3a7c87a6d25531d0ab33c8faa31b4f10e373f5 | 1,089 | py | Python | utils/request.py | saptarshibasu15/API | f83ce39e46fb058e33ff5c6a36671fa004363de9 | [
"MIT"
] | 1 | 2021-05-01T02:25:27.000Z | 2021-05-01T02:25:27.000Z | utils/request.py | saptarshibasu15/API | f83ce39e46fb058e33ff5c6a36671fa004363de9 | [
"MIT"
] | null | null | null | utils/request.py | saptarshibasu15/API | f83ce39e46fb058e33ff5c6a36671fa004363de9 | [
"MIT"
] | null | null | null | from quart import Request as BaseRequest
from typing import Optional
from api.models import User
class Request(BaseRequest):
"""Custom request class to implement authorization."""
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._user = None
self.__has_fet... | 24.2 | 73 | 0.615243 |
1c3a8c56543c4ec65cc7575eab9aa5d09bc0d6f9 | 3,668 | py | Python | toontown/classicchars/DistributedMickey.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/classicchars/DistributedMickey.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/classicchars/DistributedMickey.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from pandac.PandaModules import *
from toontown.classicchars import DistributedCCharBase
from direct.directnotify import DirectNotifyGlobal
from direct.fsm import ClassicFSM, State
from direct.fsm import State
from toontown.classicchars import CharStateDatas
from toontown.toonbase import ToontownGlobals
from toontown.t... | 36.68 | 270 | 0.681843 |
1c3ab5d14a60389fd672956ef912ecce50ed78dc | 2,359 | py | Python | src/python/zensols/garmdown/backup.py | garmin-data/garmdown | 5f466ebb0b9450890d5fc75336ccafa3654a9464 | [
"MIT"
] | 14 | 2020-01-13T10:39:35.000Z | 2021-12-19T13:17:46.000Z | src/python/zensols/garmdown/backup.py | garmin-data/garmdown | 5f466ebb0b9450890d5fc75336ccafa3654a9464 | [
"MIT"
] | 4 | 2020-02-28T08:39:17.000Z | 2021-02-28T19:05:06.000Z | src/python/zensols/garmdown/backup.py | garmin-data/garmdown | 5f466ebb0b9450890d5fc75336ccafa3654a9464 | [
"MIT"
] | 6 | 2020-04-22T06:12:07.000Z | 2022-01-02T13:25:24.000Z | import logging
from pathlib import Path
from datetime import datetime
import shutil as su
from zensols.persist import persisted
from zensols.garmdown import (
Backup,
Persister,
)
logger = logging.getLogger(__name__)
class Backuper(object):
"""Backup the SQLite database on a periodic basis.
"""
... | 31.039474 | 86 | 0.607037 |
1c3ad27979f8587c4744196d0b2622701d53b174 | 4,444 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_vm_profile.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_vm_profile.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/v2019_03_01/models/virtual_machine_scale_set_vm_profile.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 54.864198 | 170 | 0.707021 |
1c3af43fb511853ff61c8fae924b0d3c70187d2e | 1,706 | py | Python | toontown/ai/DistributedAprilToonsMgr.py | LittleNed/toontown-stride | 1252a8f9a8816c1810106006d09c8bdfe6ad1e57 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | toontown/ai/DistributedAprilToonsMgr.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | null | null | null | toontown/ai/DistributedAprilToonsMgr.py | NoraTT/Historical-Commits-Project-Altis-Source | fe88e6d07edf418f7de6ad5b3d9ecb3d0d285179 | [
"Apache-2.0"
] | 4 | 2019-06-20T23:45:23.000Z | 2020-10-14T20:30:15.000Z | from direct.distributed.DistributedObject import DistributedObject
from direct.directnotify import DirectNotifyGlobal
from toontown.toonbase.AprilToonsGlobals import *
from toontown.toonbase import ToontownGlobals
class DistributedAprilToonsMgr(DistributedObject):
notify = DirectNotifyGlobal.directNotify.newCatego... | 38.772727 | 107 | 0.697538 |
1c3b067e5ceed6737730ff58e1ac4790a027212a | 444 | py | Python | arc/arc017/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | arc/arc017/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | arc/arc017/a/main.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
import math
from collections import defaultdict, deque
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
def is_prime(x):
for i in range(2, int(math.sqrt(x)) + 1):
... | 18.5 | 53 | 0.617117 |
1c3b196bf441c75de9b48e2bfc9dfd8364686b6a | 2,579 | py | Python | src/sdk/pynni/nni/platform/local.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | null | null | null | src/sdk/pynni/nni/platform/local.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | null | null | null | src/sdk/pynni/nni/platform/local.py | logenBupt/nni | 699ec812e749ae8d060c3862d5775864ab043cd2 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to u... | 38.492537 | 100 | 0.705312 |
1c3b5c6e0d48501de1a38795e0fcf84cb9e36606 | 16,927 | py | Python | seml/config.py | cqql/seml | 9c0c8fed0135508e1f151662843af6d6adf7102b | [
"MIT"
] | 69 | 2019-12-14T06:04:54.000Z | 2022-03-24T08:58:23.000Z | seml/config.py | cqql/seml | 9c0c8fed0135508e1f151662843af6d6adf7102b | [
"MIT"
] | 60 | 2020-04-02T13:19:20.000Z | 2022-03-31T10:24:43.000Z | seml/config.py | cqql/seml | 9c0c8fed0135508e1f151662843af6d6adf7102b | [
"MIT"
] | 21 | 2020-04-02T10:04:51.000Z | 2022-03-23T17:34:10.000Z | import logging
import numpy as np
import yaml
import ast
import jsonpickle
import json
import os
from pathlib import Path
import copy
from itertools import combinations
from seml.sources import import_exe
from seml.parameters import sample_random_configs, generate_grid, cartesian_product_dict
from seml.utils import me... | 38.734554 | 120 | 0.659184 |
1c3b62adbe33c307499ef5ecfd5530a3a22e0a35 | 10,715 | py | Python | jwplatform/upload.py | jwplayer/jwplayer-py | 2f478550414145e9d36b1cdf901dcf5360f8fe2b | [
"MIT"
] | 37 | 2016-09-14T20:34:42.000Z | 2022-02-15T06:47:21.000Z | jwplatform/upload.py | jwplayer/jwplayer-py | 2f478550414145e9d36b1cdf901dcf5360f8fe2b | [
"MIT"
] | 24 | 2016-11-16T21:36:13.000Z | 2022-02-18T14:37:35.000Z | jwplatform/upload.py | jwplayer/jwplayer-py | 2f478550414145e9d36b1cdf901dcf5360f8fe2b | [
"MIT"
] | 45 | 2016-10-13T08:41:35.000Z | 2022-03-06T02:31:23.000Z | import http.client
import logging
import math
import os
from dataclasses import dataclass
from enum import Enum
from hashlib import md5
from urllib.parse import urlparse
MAX_PAGE_SIZE = 1000
MIN_PART_SIZE = 5 * 1024 * 1024
UPLOAD_BASE_URL = 'upload.jwplayer.com'
MAX_FILE_SIZE = 25 * 1000 * 1024 * 1024
class UploadTy... | 37.996454 | 120 | 0.629585 |
1c3b88c9aac619ae987c9d5fcf65026bf68d19ee | 1,355 | py | Python | test/test_segment_word.py | bertsky/ocrd_tesserocr | c0e1440a53722d617e356901cec79e14b7999c94 | [
"MIT"
] | 37 | 2018-04-16T20:18:25.000Z | 2022-03-06T09:06:12.000Z | test/test_segment_word.py | bertsky/ocrd_tesserocr | c0e1440a53722d617e356901cec79e14b7999c94 | [
"MIT"
] | 162 | 2018-04-18T12:17:53.000Z | 2022-03-09T11:07:36.000Z | test/test_segment_word.py | bertsky/ocrd_tesserocr | c0e1440a53722d617e356901cec79e14b7999c94 | [
"MIT"
] | 12 | 2018-04-11T11:56:22.000Z | 2021-02-12T15:12:13.000Z | import os
import shutil
from test.base import TestCase, main, assets
from ocrd import Resolver
from ocrd_tesserocr import TesserocrSegmentRegion
from ocrd_tesserocr import TesserocrSegmentLine
from ocrd_tesserocr import TesserocrSegmentWord
#METS_HEROLD_SMALL = assets.url_of('SBB0000F29300010000/mets_one_file.xml')
... | 30.111111 | 89 | 0.684871 |
1c3b89ac20e89e529baf47b178aa860d90f2e7ed | 3,901 | py | Python | cinder/api/v1/router.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/api/v1/router.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | 2 | 2018-10-25T13:04:01.000Z | 2019-08-17T13:15:24.000Z | cinder/api/v1/router.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | 2 | 2018-10-17T13:32:50.000Z | 2018-11-08T08:39:39.000Z | # Copyright 2011 OpenStack Foundation
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance wi... | 41.946237 | 78 | 0.616765 |
1c3b9a147a8ab5ee9b8b9425ba2e1e83038eb05c | 59 | py | Python | detcon/__init__.py | isaaccorley/detcon-pytorch | a5e03faf0c27bdbe64b72625873c0b2d3a696f04 | [
"MIT"
] | 5 | 2021-10-30T05:10:42.000Z | 2022-03-26T08:44:17.000Z | detcon/__init__.py | isaaccorley/detcon-pytorch | a5e03faf0c27bdbe64b72625873c0b2d3a696f04 | [
"MIT"
] | 2 | 2021-12-20T08:52:50.000Z | 2021-12-28T15:14:48.000Z | detcon/__init__.py | isaaccorley/detcon-pytorch | a5e03faf0c27bdbe64b72625873c0b2d3a696f04 | [
"MIT"
] | 1 | 2022-02-01T11:02:40.000Z | 2022-02-01T11:02:40.000Z | from . import datasets, losses
from .models import DetConB
| 19.666667 | 30 | 0.79661 |
1c3baf888f5130998962f4ec6d561434293266db | 9,714 | py | Python | archive/scripts/STIPS_Input_from_Sims/wingtips.py | benw1/WINGS | 32d4bfd073da0b86d2340cde25a5601d0a1ec95e | [
"RSA-MD"
] | 4 | 2022-01-04T18:24:56.000Z | 2022-01-27T08:23:37.000Z | scratch/test_phat/wingtips.py | benw1/WINGS | 32d4bfd073da0b86d2340cde25a5601d0a1ec95e | [
"RSA-MD"
] | null | null | null | scratch/test_phat/wingtips.py | benw1/WINGS | 32d4bfd073da0b86d2340cde25a5601d0a1ec95e | [
"RSA-MD"
] | null | null | null | #! /usr/bin/env python
'''
WFIRST Infrared Nearby Galaxies Test Image Product Simulator
Produces input files for the WFIRST STIPS simulator
'''
import time
import numpy as np
from astropy import wcs
from astropy.io import fits, ascii
from astropy.table import Table
class WingTips:
'''
Initialize WingTips objec... | 34.692857 | 122 | 0.561149 |
1c3bbb7ca9541a8bea721a842cf1ed28423a4111 | 9,768 | py | Python | pkgcore/test/test_plugin.py | pombreda/pkgcore | b438fc573af1a031d7ce12adbbf299bab5338451 | [
"BSD-3-Clause"
] | 1 | 2021-07-05T13:10:18.000Z | 2021-07-05T13:10:18.000Z | pkgcore/test/test_plugin.py | vapier/pkgcore | 35a7e4f4f0fc61dd9c4dc72d35a57e2e9d5b832f | [
"BSD-3-Clause"
] | 8 | 2015-03-24T14:21:44.000Z | 2015-03-24T14:21:44.000Z | pkgcore/test/test_plugin.py | vapier/pkgcore | 35a7e4f4f0fc61dd9c4dc72d35a57e2e9d5b832f | [
"BSD-3-Clause"
] | null | null | null | # Copyright: 2011 Brian Harring <ferringb@gmail.com>
# Copyright: 2006 Marien Zwart <marienz@gentoo.org>
# License: BSD/GPL2
import logging
import os
import shutil
import sys
import tempfile
from snakeoil import lists
from snakeoil.osutils import pjoin
from pkgcore import plugin
from pkgcore.test import silence_logg... | 32.778523 | 79 | 0.627662 |
1c3c10767b90990f4219390186db711aa2387ba1 | 1,949 | py | Python | sparv/util/install.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | null | null | null | sparv/util/install.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | null | null | null | sparv/util/install.py | heatherleaf/sparv-pipeline | 0fe5f27d0d82548ecc6cb21a69289668aac54cf1 | [
"MIT"
] | null | null | null | """Util functions for installations on remote servers."""
import logging
import os
import subprocess
from glob import glob
from sparv.util import system
log = logging.getLogger(__name__)
def install_file(host, local_file, remote_file):
"""Rsync a file to a target host."""
system.rsync(local_file, host, rem... | 33.603448 | 112 | 0.647512 |
1c3c35218d2c88b973ab6e73fd319baf9b30cd97 | 5,599 | py | Python | domainbed/lib/misc.py | abhimanyudubey/DomainBed | 5c8373e40a04035081937b0fa3eb4fa5339dae32 | [
"MIT"
] | 6 | 2021-08-05T11:50:34.000Z | 2022-02-28T15:29:09.000Z | domainbed/lib/misc.py | abhimanyudubey/DomainBed | 5c8373e40a04035081937b0fa3eb4fa5339dae32 | [
"MIT"
] | null | null | null | domainbed/lib/misc.py | abhimanyudubey/DomainBed | 5c8373e40a04035081937b0fa3eb4fa5339dae32 | [
"MIT"
] | 1 | 2021-09-30T12:25:07.000Z | 2021-09-30T12:25:07.000Z | """
Things that don't belong anywhere else
"""
import hashlib
import json
import os
import sys
from shutil import copyfile
from collections import OrderedDict
from numbers import Number
import operator
import numpy as np
import torch
import tqdm
from collections import Counter
import torch.nn.functional as F
def cr... | 27.312195 | 88 | 0.607609 |
1c3c3c3f5de7ac97e3100fb5bc9489bb547d89ef | 8,851 | py | Python | TrainingExtensions/common/src/python/aimet_common/cache.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/common/src/python/aimet_common/cache.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | TrainingExtensions/common/src/python/aimet_common/cache.py | lipovsek/aimet | 236fb02cc6c45e65c067030416c49a09ace82045 | [
"BSD-3-Clause"
] | null | null | null | # /usr/bin/env python3.6
# -*- mode: python -*-
# =============================================================================
# @@-COPYRIGHT-START-@@
#
# Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification,... | 40.231818 | 98 | 0.650322 |
1c3c3f457bc93c4d38f911ff7c9e924cbda143ee | 5,918 | py | Python | dvc/command/run.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:28:11.000Z | 2019-09-02T00:28:11.000Z | dvc/command/run.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | null | null | null | dvc/command/run.py | drorata/dvc | b6bc65fcbf269b94b7c1ce2d9dff641dedb039b0 | [
"Apache-2.0"
] | 1 | 2019-09-02T00:29:40.000Z | 2019-09-02T00:29:40.000Z | from __future__ import unicode_literals
import argparse
import logging
from dvc.command.base import CmdBase, append_doc_link
from dvc.exceptions import DvcException
logger = logging.getLogger(__name__)
class CmdRun(CmdBase):
def run(self):
overwrite = self.args.yes or self.args.overwrite_dvcfile
... | 30.193878 | 79 | 0.562521 |
1c3c7bb344aae3a98a185fc2c2dd8d5249cc62d9 | 17,483 | py | Python | src/trparser.py | traildb/trck | 64304f00f352fc023ef092c6c5332dfd3963fda7 | [
"MIT"
] | 53 | 2017-03-21T02:59:31.000Z | 2021-07-26T10:05:00.000Z | src/trparser.py | traildb/trck | 64304f00f352fc023ef092c6c5332dfd3963fda7 | [
"MIT"
] | 16 | 2017-04-10T19:29:56.000Z | 2018-06-28T17:07:18.000Z | src/trparser.py | traildb/trck | 64304f00f352fc023ef092c6c5332dfd3963fda7 | [
"MIT"
] | 14 | 2017-03-21T18:03:21.000Z | 2019-02-08T11:51:21.000Z | from __future__ import print_function
import ply.lex as lex
from itertools import groupby
from datetime import datetime
import re
class ParseError(Exception):
def __init__(self, message, **kwargs):
super(Exception, self).__init__(message)
self.info = kwargs
reserved = set(['after', 'receive', 'yi... | 26.773354 | 142 | 0.517531 |
1c3ccf3e4cb85f0d97103912a0a229d42a88b9b8 | 6,406 | py | Python | tests/test_routing.py | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 | [
"MIT"
] | 11 | 2021-06-21T19:56:01.000Z | 2021-12-22T09:06:09.000Z | tests/test_routing.py | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 | [
"MIT"
] | null | null | null | tests/test_routing.py | Vsevolod-pl/hivemind | 0300cfd91adeb14d91d9659a98221628f9b775b9 | [
"MIT"
] | null | null | null | import random
import heapq
import operator
from itertools import chain, zip_longest
from hivemind import LOCALHOST
from hivemind.dht.routing import RoutingTable, DHTID
def test_ids_basic():
# basic functionality tests
for i in range(100):
id1, id2 = DHTID.generate(), DHTID.generate()
assert D... | 46.42029 | 117 | 0.655948 |
1c3cf842406fc99a73b9ac61e512db5b70718811 | 2,563 | py | Python | mcarch/views/user.py | Scotsguy/MCArchive | 89847bab722c6782fa53c7b11ee83f1f5b2d9f05 | [
"MIT"
] | null | null | null | mcarch/views/user.py | Scotsguy/MCArchive | 89847bab722c6782fa53c7b11ee83f1f5b2d9f05 | [
"MIT"
] | null | null | null | mcarch/views/user.py | Scotsguy/MCArchive | 89847bab722c6782fa53c7b11ee83f1f5b2d9f05 | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, url_for, redirect, abort, flash, request
from flask_wtf import FlaskForm
from wtforms.fields import StringField, PasswordField
from wtforms.validators import DataRequired, Length, EqualTo
from mcarch.app import db
from mcarch.model.user import User, ResetToken
from mcarch... | 37.144928 | 90 | 0.676551 |
1c3d19aca39c51b03373b7a4807c22d627923035 | 31 | py | Python | custom_components/metlocationforecast/__init__.py | toringer/home-assistant-metlocationforecast | aa336683aa944050d730b719cc691ef643c46bf9 | [
"MIT"
] | null | null | null | custom_components/metlocationforecast/__init__.py | toringer/home-assistant-metlocationforecast | aa336683aa944050d730b719cc691ef643c46bf9 | [
"MIT"
] | null | null | null | custom_components/metlocationforecast/__init__.py | toringer/home-assistant-metlocationforecast | aa336683aa944050d730b719cc691ef643c46bf9 | [
"MIT"
] | null | null | null | """met.no location forecast.""" | 31 | 31 | 0.677419 |
1c3d2af11592b23293e1b67e8a4a20bc495a69bc | 4,695 | py | Python | services/web/server/src/simcore_service_webserver/reverse_proxy/handlers/jupyter.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | services/web/server/src/simcore_service_webserver/reverse_proxy/handlers/jupyter.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | 2 | 2018-05-13T09:10:57.000Z | 2019-03-06T08:10:40.000Z | services/web/server/src/simcore_service_webserver/reverse_proxy/handlers/jupyter.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | """ Reverse-proxy customized for jupyter notebooks
"""
import asyncio
import logging
import pprint
import aiohttp
from aiohttp import client, web
from yarl import URL
APP_SOCKETS_KEY = "simcore_service_webserver.reverse_proxy.settings.sockets"
#FIXME: Image tag should determine the handler instead of the opposite!... | 40.474138 | 130 | 0.553781 |
1c3d39aedabb1f844935ea61dc4717df9a03b4e1 | 2,868 | py | Python | classify_tool_data_marks.py | skbly7/usefulness | ed11cd55080d553cf62873999a5e00b154057fbc | [
"MIT"
] | null | null | null | classify_tool_data_marks.py | skbly7/usefulness | ed11cd55080d553cf62873999a5e00b154057fbc | [
"MIT"
] | null | null | null | classify_tool_data_marks.py | skbly7/usefulness | ed11cd55080d553cf62873999a5e00b154057fbc | [
"MIT"
] | null | null | null | import cPickle as pickle
import collections
import csv
import bs4
import re
import markdown
from textpreprocess import textpreprocess
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
with open('trained_model.pickle', 'rb') as handle:
vectorizer, clf, svd = pickle.load(handle)
android = False
file_reader = o... | 26.311927 | 112 | 0.582985 |
1c3d3d0cb411845f0bc1f2fc13c35d8cbe8a9463 | 4,393 | py | Python | src/demo_music_critic/plotter.py | fcr/Haifa_Tech_Meetup_Talk | d33a74dac894d2c5cd6aa49e1a60a7df284c0f8f | [
"MIT"
] | 4 | 2020-04-08T03:02:09.000Z | 2021-11-05T12:24:34.000Z | src/demo_music_critic/plotter.py | fcr/python_meetup_htm_slides | ef261cd2ec0bb81ecdd829420ae273baff3892cf | [
"MIT"
] | null | null | null | src/demo_music_critic/plotter.py | fcr/python_meetup_htm_slides | ef261cd2ec0bb81ecdd829420ae273baff3892cf | [
"MIT"
] | 1 | 2020-12-04T03:23:11.000Z | 2020-12-04T03:23:11.000Z | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... | 27.628931 | 95 | 0.681539 |
1c3d63f3ca3f863d5ff4c28c90d4cd50d9d151b5 | 277 | py | Python | examples/protocols/adherent/app/decorators.py | pauleveritt/viewdom_wired | 40d8f2f190a12bbd07ff957654626001a9f3a778 | [
"MIT"
] | null | null | null | examples/protocols/adherent/app/decorators.py | pauleveritt/viewdom_wired | 40d8f2f190a12bbd07ff957654626001a9f3a778 | [
"MIT"
] | null | null | null | examples/protocols/adherent/app/decorators.py | pauleveritt/viewdom_wired | 40d8f2f190a12bbd07ff957654626001a9f3a778 | [
"MIT"
] | null | null | null | from typing import Callable, Type, TypeVar
protocol = TypeVar("protocol")
def adherent(
c: Callable[[], protocol]
) -> Callable[[Type[protocol]], Type[protocol]]:
def decor(input_value: Type[protocol]) -> Type[protocol]:
return input_value
return decor
| 21.307692 | 61 | 0.68231 |
1c3d76d4de348b82b1075684a68a02ac889e29e0 | 4,069 | py | Python | shellshock-hunter-google.py | DanMcInerney/shellshock-hunter-google | 98f5864a2cb5121ae2d3705c3e119416b362a504 | [
"Apache-2.0"
] | 27 | 2015-01-09T23:36:10.000Z | 2021-12-12T22:44:45.000Z | shellshock-hunter-google.py | DanMcInerney/shellshock-hunter-google | 98f5864a2cb5121ae2d3705c3e119416b362a504 | [
"Apache-2.0"
] | 1 | 2019-02-12T15:01:12.000Z | 2019-02-12T20:30:33.000Z | shellshock-hunter-google.py | DanMcInerney/shellshock-hunter-google | 98f5864a2cb5121ae2d3705c3e119416b362a504 | [
"Apache-2.0"
] | 14 | 2015-05-14T09:59:08.000Z | 2020-05-30T00:41:15.000Z | #!/usr/bin/env python2
# -*- coding: utf8 -*-
from gevent import monkey
monkey.patch_all()
import sys
import time
import random
import argparse
import urllib2
from gevent.pool import Pool
from gevent import joinall
from selenium import webdriver
from selenium.webdriver.support.ui import Select, WebDri... | 35.382609 | 139 | 0.646105 |
1c3d9435ab7a896c410873e3b7a791c68d73bd9a | 12,259 | py | Python | dragonfire/utilities.py | Booteille/Dragonfire | 17d67c89d46a0f29cee99239109fddfccc5e6ab3 | [
"MIT"
] | 1 | 2019-07-11T05:48:43.000Z | 2019-07-11T05:48:43.000Z | dragonfire/utilities.py | AzureMentor/Dragonfire | a3c034ab672b14329ed465dc39d944a6ec42872f | [
"MIT"
] | 2 | 2022-02-10T06:30:37.000Z | 2022-02-10T06:50:22.000Z | dragonfire/utilities.py | Allyn69/Dragonfire | 4c0e873e0bee3553bf14dfb1dded85e7fa515434 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: utilities
:platform: Unix
:synopsis: the top-level submodule of Dragonfire that provides various utility tools for different kind of tasks.
.. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr>
"""
import inspect # Inspect live objec... | 40.193443 | 202 | 0.566441 |
1c3d98a532ec8d1cca2d7cb9d727c60954170e02 | 7,978 | py | Python | alipay/aop/api/domain/PosDiscountDetail.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/PosDiscountDetail.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/PosDiscountDetail.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class PosDiscountDetail(object):
def __init__(self):
self._activity_id = None
self._activity_type = None
self._discount_name = None
self._discount_type = None
se... | 33.805085 | 97 | 0.615693 |
1c3d9f21cd8b359f626503d515a007a07201ebdf | 1,821 | py | Python | bin/Package/MaybeVirtualPackageBase.py | juergenhoetzel/craft | 9d3fe6dc07f2307e8f8212c8981b980a9d2d28fd | [
"BSD-2-Clause"
] | null | null | null | bin/Package/MaybeVirtualPackageBase.py | juergenhoetzel/craft | 9d3fe6dc07f2307e8f8212c8981b980a9d2d28fd | [
"BSD-2-Clause"
] | null | null | null | bin/Package/MaybeVirtualPackageBase.py | juergenhoetzel/craft | 9d3fe6dc07f2307e8f8212c8981b980a9d2d28fd | [
"BSD-2-Clause"
] | null | null | null | from Package.VirtualPackageBase import *
from Blueprints.CraftVersion import CraftVersion
import Utils.CraftCache
class MaybeVirtualPackageBase(object):
def __init__(self, condition, classA, classB=VirtualPackageBase):
if condition:
self.baseClass = classA
else:
self.baseCl... | 41.386364 | 125 | 0.667765 |
1c3dcf3bfe9eada9f0685932fa73f16baeaacef1 | 61,254 | py | Python | src/fractalshades/numpy_utils/xrange.py | GBillotey/Fractal-shades | 99c690cb1114ab7edcbfd9836af585fed2b133e8 | [
"MIT"
] | 3 | 2021-03-06T18:32:51.000Z | 2021-07-07T01:35:21.000Z | src/fractalshades/numpy_utils/xrange.py | GBillotey/Fractal-shades | 99c690cb1114ab7edcbfd9836af585fed2b133e8 | [
"MIT"
] | null | null | null | src/fractalshades/numpy_utils/xrange.py | GBillotey/Fractal-shades | 99c690cb1114ab7edcbfd9836af585fed2b133e8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
import numbers
import re
import mpmath
#import time
def mpc_to_Xrange(mpc, dtype=np.complex128):
""" Convert a mpc complex to a Xrange array"""
select = {np.dtype(np.complex64): np.float32,
np.dtype(np.complex128): np.float64}
float_type = select[np... | 37.078692 | 90 | 0.53794 |
1c3e4d48552630c2b67eed26096157fd2ff94ad5 | 9,209 | py | Python | get_turk_useful_res.py | NinaCalvi/OKBC | e25ad0296137ed354593c74509b077a22f60425e | [
"MIT"
] | 6 | 2020-07-06T14:31:18.000Z | 2021-09-13T10:15:14.000Z | get_turk_useful_res.py | NinaCalvi/OKBC | e25ad0296137ed354593c74509b077a22f60425e | [
"MIT"
] | 2 | 2021-09-12T17:49:09.000Z | 2021-09-14T15:28:54.000Z | get_turk_useful_res.py | NinaCalvi/OKBC | e25ad0296137ed354593c74509b077a22f60425e | [
"MIT"
] | 1 | 2021-06-07T01:46:44.000Z | 2021-06-07T01:46:44.000Z | # This code is used to generate an analysis html for the results of the mturk batch of project -
# TexKBC useful? (id=1419750).
# It requires the results.csv downloaded from mturk.
# Quality control is done, by giving all true facts (data from test.txt, which is known to be true)
# If turker choses false, then that hit... | 40.03913 | 162 | 0.621349 |
1c3e54391ff27af20fc3bcfa1e1f3e00e98acf7f | 2,558 | py | Python | tests/ext/django/test_db.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 294 | 2017-10-10T19:01:04.000Z | 2022-03-18T15:52:19.000Z | tests/ext/django/test_db.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 285 | 2017-10-20T09:27:21.000Z | 2022-03-29T15:33:45.000Z | tests/ext/django/test_db.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 134 | 2017-10-11T13:55:17.000Z | 2022-03-23T07:21:17.000Z | import django
import pytest
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core.context import Context
from aws_xray_sdk.ext.django.db import patch_db
@pytest.fixture(scope='module', autouse=True)
def setup():
django.setup()
xray_recorder.configure(context=Context(),
... | 29.068182 | 79 | 0.686083 |
1c3e6793967ef5707643ead3c0be75ed24cd0414 | 10,245 | py | Python | api_tests/nodes/views/test_node_links_detail.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | api_tests/nodes/views/test_node_links_detail.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | 4 | 2016-05-13T14:24:16.000Z | 2017-03-30T15:28:31.000Z | api_tests/nodes/views/test_node_links_detail.py | hmoco/osf.io | a02869f9b5c198bafae7cea0c216674bbcba62f7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from nose.tools import * # flake8: noqa
from urlparse import urlparse
from framework.auth.core import Auth
from website.models import NodeLog
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from osf_tests.factories import (
ProjectFactory,
Registrat... | 48.098592 | 121 | 0.686774 |
1c3e9ab846f7918dcf9e79fdc7c1a3960ef0324e | 1,408 | py | Python | terrascript/opsgenie/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/opsgenie/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/opsgenie/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/opsgenie/r.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class opsgenie_alert_policy(terrascript.Resource):
pass
class opsgenie_api_integration(terrascript.R... | 16.372093 | 79 | 0.791193 |
1c3e9b81fd617497d11f8c7dfa97e3268d0c825b | 17,342 | py | Python | backend/backend/utils/key_client.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | 2 | 2022-03-17T04:50:20.000Z | 2022-03-17T04:51:31.000Z | backend/backend/utils/key_client.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | backend/backend/utils/key_client.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | import logging
import secrets
import uuid
from decimal import Decimal
from typing import List, Optional, Sequence
import petlib.ec
import sqlalchemy.orm
from common.constants import ADMIN_UUID, SECP256K1_ORDER, Blockchain, Currency
from common.utils.uuid import generate_uuid4
from common.utils.zk import NIZK
from comm... | 41.787952 | 116 | 0.589897 |
1c3e9e2c60ee00b4900a5d98d0339667c62cd6c3 | 1,165 | py | Python | test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 30.657895 | 94 | 0.635193 |
1c3ea3db82bc9ca8412c76aa081720e97c4c8d00 | 8,617 | py | Python | moler/connection_factory.py | AdamKlekowski/moler | 9d032bad402d9863685b2a8624320566512c14cc | [
"BSD-3-Clause"
] | 2 | 2021-03-14T15:17:10.000Z | 2021-03-15T07:12:12.000Z | moler/connection_factory.py | Laymer/moler | 2d7b89efdc2ca5e9975112b97934b396e24b5505 | [
"BSD-3-Clause"
] | null | null | null | moler/connection_factory.py | Laymer/moler | 2d7b89efdc2ca5e9975112b97934b396e24b5505 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
One of Moler's goals is to be IO-agnostic.
So it can be used under twisted, asyncio, curio any any other IO system.
Moler's connection is very thin layer binding Moler's ConnectionObserver with external IO system.
Connection responsibilities:
- have a means for sending outgoing data via ext... | 43.520202 | 128 | 0.678542 |
1c3ebe5799f9f096dadc724348ff63069ef11359 | 1,884 | py | Python | alipay/aop/api/response/AlipayFundTransPayResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayFundTransPayResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayFundTransPayResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayFundTransPayResponse(AlipayResponse):
def __init__(self):
super(AlipayFundTransPayResponse, self).__init__()
self._order_id = None
self._out_biz_no = No... | 28.545455 | 99 | 0.664544 |
1c3ef5954090ff2844946ed9928596b498fc65ba | 3,200 | py | Python | sqlalchemy_collectd/client/tests/test_plugin.py | jvanasco/sqlalchemy-collectd | 8fb2aa04aa66b3b4edfdf04dce1eca70b4a1ab5e | [
"MIT"
] | null | null | null | sqlalchemy_collectd/client/tests/test_plugin.py | jvanasco/sqlalchemy-collectd | 8fb2aa04aa66b3b4edfdf04dce1eca70b4a1ab5e | [
"MIT"
] | null | null | null | sqlalchemy_collectd/client/tests/test_plugin.py | jvanasco/sqlalchemy-collectd | 8fb2aa04aa66b3b4edfdf04dce1eca70b4a1ab5e | [
"MIT"
] | null | null | null | import unittest
import mock
from sqlalchemy.engine import url as sqla_url
from .. import plugin
class PluginTest(unittest.TestCase):
def test_start_no_args(self):
with mock.patch.object(plugin, "start_plugin") as start_plugin:
url = sqla_url.URL("mysql+pymysql://scott:tiger@localhost/")
... | 36.781609 | 79 | 0.584688 |
1c3f37b0d6abe80e9abf5047bd200068d3915b3b | 280 | py | Python | camper/pages/templatetags/pages_tags.py | drinks/camper | 82d9f1342886d91bf6787c1bcdb1a7cb62e53ca3 | [
"BSD-3-Clause"
] | null | null | null | camper/pages/templatetags/pages_tags.py | drinks/camper | 82d9f1342886d91bf6787c1bcdb1a7cb62e53ca3 | [
"BSD-3-Clause"
] | null | null | null | camper/pages/templatetags/pages_tags.py | drinks/camper | 82d9f1342886d91bf6787c1bcdb1a7cb62e53ca3 | [
"BSD-3-Clause"
] | null | null | null | from django import template
from camper.pages.models import Chunk
register = template.Library()
@register.simple_tag(name='chunk')
def do_chunk(slug):
try:
c = Chunk.objects.get(slug=slug)
return c.content
except Chunk.DoesNotExist:
return ''
| 17.5 | 40 | 0.682143 |
1c3f85e1028366c5f6c8a26ba5ec68082c8dc435 | 602 | py | Python | tools/gui_patch.py | facelessuser/Rummage | 74f0ce1b078eef40c3ba683dbc4638112f3b9bb7 | [
"MIT"
] | 55 | 2015-02-15T08:17:55.000Z | 2022-03-11T11:55:39.000Z | tools/gui_patch.py | facelessuser/Rummage | 74f0ce1b078eef40c3ba683dbc4638112f3b9bb7 | [
"MIT"
] | 264 | 2015-01-29T20:27:40.000Z | 2022-03-03T04:08:48.000Z | tools/gui_patch.py | facelessuser/Rummage | 74f0ce1b078eef40c3ba683dbc4638112f3b9bb7 | [
"MIT"
] | 12 | 2017-08-30T22:54:20.000Z | 2022-03-21T01:05:50.000Z | """Patch graphical user interface file."""
import codecs
import re
filename = 'rummage/lib/gui/gui.py'
with codecs.open(filename, 'r', encoding='utf-8') as f:
text = f.read()
# Add collapsible pane replacement
text = re.sub(
r'^((?:import|from)(?! \.controls\.collapsible_pane).*?)(\r?\n){2}',
r'\1\2from ... | 22.296296 | 92 | 0.646179 |
1c3fd8926309431eb4f88378356064832fc6f8c6 | 149 | py | Python | febio_python/test/test_feb.py | Nobregaigor/febio-python | 6895b4e2f8959444a66b6f77a000ce193c3357a7 | [
"MIT"
] | null | null | null | febio_python/test/test_feb.py | Nobregaigor/febio-python | 6895b4e2f8959444a66b6f77a000ce193c3357a7 | [
"MIT"
] | null | null | null | febio_python/test/test_feb.py | Nobregaigor/febio-python | 6895b4e2f8959444a66b6f77a000ce193c3357a7 | [
"MIT"
] | null | null | null | import unittest
from febio_python import feb
class test_feb(unittest.TestCase):
def test_load_feb(self):
feb.FEBio_feb("./sample.feb")
| 18.625 | 37 | 0.731544 |
1c3fdb75e6069de112bca35146a844c47b3af97c | 8,504 | py | Python | ADBShell.py | AlvISsReimu/ArknightsAutoHelper | 7112b73c01fe381b20314342ba0dfa2f7e01805d | [
"MIT"
] | 2 | 2021-07-14T04:03:57.000Z | 2022-03-17T03:23:19.000Z | ADBShell.py | AlvISsReimu/ArknightsAutoHelper | 7112b73c01fe381b20314342ba0dfa2f7e01805d | [
"MIT"
] | null | null | null | ADBShell.py | AlvISsReimu/ArknightsAutoHelper | 7112b73c01fe381b20314342ba0dfa2f7e01805d | [
"MIT"
] | null | null | null | import os
from config import ADB_ROOT, ADB_HOST, SCREEN_SHOOT_SAVE_PATH, ShellColor
from PIL import Image
from time import sleep
from random import randint
# from numpy import average, dot, linalg
class ADBShell(object):
def __init__(self, adb_host=ADB_HOST):
self.SCREEN_SHOOT_SAVE_PATH = os.path.abspath(... | 39.37037 | 108 | 0.549271 |
1c401dd16d84eb14e77c53697579fd3180578310 | 31 | py | Python | army_ant/server/__init__.py | feup-infolab/army-ant | 7b33120d5160f73d7a41a05e6336489c917fb75c | [
"BSD-3-Clause"
] | 5 | 2018-01-18T14:11:52.000Z | 2020-10-23T16:02:25.000Z | army_ant/server/__init__.py | feup-infolab/army-ant | 7b33120d5160f73d7a41a05e6336489c917fb75c | [
"BSD-3-Clause"
] | 10 | 2018-02-02T20:19:36.000Z | 2020-10-05T08:46:36.000Z | army_ant/server/__init__.py | feup-infolab/army-ant | 7b33120d5160f73d7a41a05e6336489c917fb75c | [
"BSD-3-Clause"
] | null | null | null | from .server import * # noqa
| 15.5 | 30 | 0.645161 |
1c4038f05efa89ab152a2e6b15a13fa3a2742bfb | 66,095 | py | Python | oscar/lib/python2.7/site-packages/whoosh/searching.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/whoosh/searching.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/whoosh/searching.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2007 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions a... | 39.960701 | 83 | 0.60696 |
1c40421ca57f259b646740244643e36fd23b79df | 2,420 | py | Python | predico/predicates.py | pauleveritt/predico | 2bbf88a7775d31907d2229a32a89490172acd988 | [
"Apache-2.0"
] | null | null | null | predico/predicates.py | pauleveritt/predico | 2bbf88a7775d31907d2229a32a89490172acd988 | [
"Apache-2.0"
] | null | null | null | predico/predicates.py | pauleveritt/predico | 2bbf88a7775d31907d2229a32a89490172acd988 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import Type, Any, Optional
from predico.services.request.base_request import Request
from predico.services.resource.base_resource import Resource
@dataclass
class Predicate:
value: Any
key: str
rank: int = 10
def __str__(self):
value = getattr(se... | 24.2 | 66 | 0.655372 |
1c40427349091ac0fefe2bc8521d70b844ce44a4 | 2,339 | py | Python | outdated-unused/OldImageProcessing.py | KhangOP/PaladinsAssistantBot | 9b705dc688610ba52909f0b0e152d8684006c6a6 | [
"MIT"
] | null | null | null | outdated-unused/OldImageProcessing.py | KhangOP/PaladinsAssistantBot | 9b705dc688610ba52909f0b0e152d8684006c6a6 | [
"MIT"
] | null | null | null | outdated-unused/OldImageProcessing.py | KhangOP/PaladinsAssistantBot | 9b705dc688610ba52909f0b0e152d8684006c6a6 | [
"MIT"
] | null | null | null |
"""
# Creates a image desks
async def create_deck_image2(player_name, champ_name, deck):
image_size_x = 256
image_size_y = 196
# Main image
# deck_image = Image.new('RGB', (image_size_x * 5, image_size_x * 2), color=color)
# Champ icon image
champ_url = await get_champ_image(champ_name)
r... | 37.126984 | 111 | 0.662676 |
1c405b033cae8c0cc0e16b1317fb1fa4ee564a69 | 689 | py | Python | e2e_dialog/setup.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | e2e_dialog/setup.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | e2e_dialog/setup.py | hscspring/chatbot | 9d0bc91db0d8834a1a75cba3edcd3133191e80af | [
"Apache-2.0"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="e2e_dialog",
version="0.0.1",
author="Yam",
author_email="haoshaochun@gmail.com",
description="Humanly Deeplearning NLP.",
long_description=long_description,
long_description_conte... | 25.518519 | 57 | 0.642961 |
1c406589588a96bfb0f30855c900c12a8e8768ae | 860 | py | Python | domain-messages/domain_messages/ControlState/__init__.py | simcesplatform/static-time-series-resource-forecaster | 0f53915d7fe6da543f628487c8e643f2e9bb2652 | [
"MIT"
] | null | null | null | domain-messages/domain_messages/ControlState/__init__.py | simcesplatform/static-time-series-resource-forecaster | 0f53915d7fe6da543f628487c8e643f2e9bb2652 | [
"MIT"
] | null | null | null | domain-messages/domain_messages/ControlState/__init__.py | simcesplatform/static-time-series-resource-forecaster | 0f53915d7fe6da543f628487c8e643f2e9bb2652 | [
"MIT"
] | null | null | null | # Copyright 2021 Tampere University and VTT Technical Research Centre of Finland
# This software was developed as a part of the ProCemPlus project: https://www.senecc.fi/projects/procemplus
# This source code is licensed under the MIT license. See LICENSE in the repository root directory.
# Author(s): Amir Safdarian <a... | 66.153846 | 108 | 0.711628 |
1c40697e10a1872eee7320fa943aea76e01aa80d | 7,643 | py | Python | pytmx/util_pygame.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | pytmx/util_pygame.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | pytmx/util_pygame.py | unmonk/Project-Infinity | 63c22fcf4086adf868967cb172434e3ceba4bac5 | [
"CC0-1.0"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
logger.addHandler(ch)
logger.setLevel(logging.INFO)
try:
from pygame.transform import flip, rotate
import pygame
except ImportError:
logger.error('cannot import pygame (is it installed?)')
raise
... | 29.855469 | 80 | 0.593223 |
1c40763425a3dd4fa423267ce2489d4f3864d171 | 10,271 | py | Python | recipes/lanso/eval.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | recipes/lanso/eval.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | recipes/lanso/eval.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
"""Recipe for training a classifier using the
mobvoihotwords Dataset.
To run this recipe, use the following command:
> python train.py {hyperparameter_file}
Using your own hyperparameter file or one of the following:
hyperparams/xvect.yaml (xvector system)
"""
import os
import sys
import torch... | 33.565359 | 80 | 0.634115 |
1c407a8836fca2986284f537934f9013606eda28 | 5,204 | py | Python | tools/langs/python.py | Breakend/libmei | c031be79a2775e8bb9b47e1057e1398232d4b293 | [
"MIT"
] | null | null | null | tools/langs/python.py | Breakend/libmei | c031be79a2775e8bb9b47e1057e1398232d4b293 | [
"MIT"
] | null | null | null | tools/langs/python.py | Breakend/libmei | c031be79a2775e8bb9b47e1057e1398232d4b293 | [
"MIT"
] | 1 | 2021-02-23T21:13:47.000Z | 2021-02-23T21:13:47.000Z | import os
import codecs
import re
import logging
lg = logging.getLogger('schemaparser')
LANG_NAME="Python"
MODULE_TEMPLATE = """
{license}
from pymei import MeiElement
{classes}
"""
MODULE_CLASS_TEMPLATE = """
class {className}_(MeiElement):
def __init__(self):
MeiElement.__init__(self, "{className}")
... | 32.525 | 101 | 0.637779 |
1c409484510aab17d13a436173f168f6acfe19e1 | 889 | py | Python | api/responders/grafana/__init__.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/responders/grafana/__init__.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | api/responders/grafana/__init__.py | korenlev/calipso-cvim | 39278a5cf09c40b26a8a143ccc0c8d437961abc2 | [
"Apache-2.0"
] | null | null | null | ###############################################################################
# Copyright (c) 2017-2020 Koren Lev (Cisco Systems), #
# Yaron Yogev (Cisco Systems), Ilia Abashin (Cisco Systems) and others #
# #
... | 55.5625 | 79 | 0.460067 |
1c40a1b821d8871c7412044d06a39c3001541806 | 7,979 | py | Python | azure/train_landcover.py | mjevans26/Satellite_ComputerVision | 013c69c5cf6f86126e6ad2d715f8b13b300e29a8 | [
"BSD-2-Clause"
] | 10 | 2020-04-06T04:51:27.000Z | 2022-02-23T16:00:43.000Z | azure/train_landcover.py | mjevans26/Satellite_ComputerVision | 013c69c5cf6f86126e6ad2d715f8b13b300e29a8 | [
"BSD-2-Clause"
] | 2 | 2020-04-06T06:25:35.000Z | 2021-03-22T21:55:41.000Z | azure/train_landcover.py | mjevans26/Satellite_ComputerVision | 013c69c5cf6f86126e6ad2d715f8b13b300e29a8 | [
"BSD-2-Clause"
] | 5 | 2020-04-18T16:44:44.000Z | 2021-08-31T00:10:08.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Sep 21 12:13:11 2021
@author: MEvans
"""
from utils import model_tools, processing
from utils.prediction_tools import makePredDataset, callback_predictions, plot_to_image
from matplotlib import pyplot as plt
import argparse
import os
import glob
import json
import math
impor... | 37.995238 | 404 | 0.691816 |
1c40b8c8b43cf840740df919cace841d79a604e2 | 2,398 | py | Python | Stereo-Vision-System/farzad/Project/Cameras/StereoCameras.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | 12 | 2017-05-26T12:04:38.000Z | 2021-07-11T04:42:19.000Z | Stereo-Vision-System/farzad/Project/Cameras/StereoCameras.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | null | null | null | Stereo-Vision-System/farzad/Project/Cameras/StereoCameras.py | tonybeltramelli/Graphics-And-Vision | a1dbeada8e907b119ecce1fe421ae91e64ff3371 | [
"Apache-2.0"
] | 4 | 2017-05-09T08:26:44.000Z | 2018-04-23T03:16:01.000Z | #<!--------------------------------------------------------------------------->
#<!-- ITU - IT University of Copenhagen -->
#<!-- SSS - Software and Systems Section -->
#<!-- File : StereoCameras.py -... | 55.767442 | 80 | 0.330275 |
1c40b91e04029a84ae33cbabeb5831f5f3e1d38e | 9,216 | py | Python | scripts/ased_search_inversion1_cifar100.py | anton-muravev/ased | 16ddb70ac3e46556cf49569915df0165a6fb7d16 | [
"Apache-2.0"
] | null | null | null | scripts/ased_search_inversion1_cifar100.py | anton-muravev/ased | 16ddb70ac3e46556cf49569915df0165a6fb7d16 | [
"Apache-2.0"
] | null | null | null | scripts/ased_search_inversion1_cifar100.py | anton-muravev/ased | 16ddb70ac3e46556cf49569915df0165a6fb7d16 | [
"Apache-2.0"
] | 1 | 2021-12-06T08:42:59.000Z | 2021-12-06T08:42:59.000Z | # -*- coding: utf-8 -*-
## INVERSION1 EXPERIMENT ON CIFAR100
import utorch
import ased
import ased_util
import sys
import time
import numpy as np
from astore import Astore
from sklearn.model_selection import StratifiedShuffleSplit
import argparse
import torch
import torch.multiprocessing as mp
import torch.nn as nn
i... | 39.384615 | 91 | 0.604601 |
1c411a1bf0ee7de1a590bca1985d65eaa7c54a69 | 3,223 | py | Python | softwareprocess/utility/aries.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | softwareprocess/utility/aries.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | softwareprocess/utility/aries.py | LordOfTheRains/cookieJar | 57838b9f5103dacad5b3bdc643905e65d576af94 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
import math
from angle import Angle
class Aries:
REFERENCE_YEAR = 2001
def __init__(self):
pass
@staticmethod
def get_greenwich_hour_angle(year, month, day, hour, minute, second):
"""
= relative_prime_meridian + earth rota... | 39.304878 | 95 | 0.645982 |
1c412b6c9fff2b4cfbc48c930166fe0ef2b6330e | 1,323 | py | Python | examples/cl_argmax.py | mgraffg/simplegp | 7e4639e3ac76571a4e67669cad6e8e775b3fc345 | [
"Apache-2.0"
] | 2 | 2015-03-18T17:26:20.000Z | 2019-03-18T17:28:16.000Z | examples/cl_argmax.py | mgraffg/simplegp | 7e4639e3ac76571a4e67669cad6e8e775b3fc345 | [
"Apache-2.0"
] | 1 | 2015-04-19T17:02:49.000Z | 2015-07-21T18:48:34.000Z | examples/cl_argmax.py | mgraffg/simplegp | 7e4639e3ac76571a4e67669cad6e8e775b3fc345 | [
"Apache-2.0"
] | null | null | null | from SimpleGP import GPPDE
import numpy as np
class Cl2(GPPDE):
def random_func(self, first_call=False):
if first_call:
# this is the argmax
return 16
return super(Cl2, self).random_func(first_call=first_call)
fpt = open('data/iris.npy', 'rb')
X = np.load(fpt)
cl = np.load... | 19.746269 | 67 | 0.572184 |
1c412f4130ff5f913dace2ba173b9fc3ee9e201a | 24,090 | py | Python | lib/googlecloudsdk/calliope/arg_parsers.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/calliope/arg_parsers.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/googlecloudsdk/calliope/arg_parsers.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:23:41.000Z | 2020-07-25T12:23:41.000Z | # Copyright 2013 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 32.379032 | 80 | 0.653881 |
1c414ec054ba0da54f927fb23732049665126be2 | 799 | py | Python | octopus/task/utils.py | quaintm/octopus | 95a732207ee5f43cd0065d8ea6c643cbf3df2d61 | [
"BSD-3-Clause"
] | null | null | null | octopus/task/utils.py | quaintm/octopus | 95a732207ee5f43cd0065d8ea6c643cbf3df2d61 | [
"BSD-3-Clause"
] | null | null | null | octopus/task/utils.py | quaintm/octopus | 95a732207ee5f43cd0065d8ea6c643cbf3df2d61 | [
"BSD-3-Clause"
] | null | null | null | from flask import flash
from flask.ext.login import current_user
from octopus.models import User, Task
def create_query(args, q):
valid = True
user_id = args.get('user_id')
type = args.get('type')
if user_id:
if user_id == "me":
user = User.get_by_id(current_user.id)
else:
try:
u... | 21.594595 | 52 | 0.598248 |
1c4161c3a422be6f32faf81d7ea781eb278f2d1c | 38 | py | Python | aws_toolbox/__init__.py | miniche/aws-toolbox | 8d334ca1f3eec449db258843cf3e396fe7879484 | [
"MIT"
] | null | null | null | aws_toolbox/__init__.py | miniche/aws-toolbox | 8d334ca1f3eec449db258843cf3e396fe7879484 | [
"MIT"
] | null | null | null | aws_toolbox/__init__.py | miniche/aws-toolbox | 8d334ca1f3eec449db258843cf3e396fe7879484 | [
"MIT"
] | null | null | null | __author__ = 'Charles-Emmanuel CAMUS'
| 19 | 37 | 0.789474 |
1c417417a4317b7aa66ae1ad89506f681b25cbf7 | 6,003 | py | Python | loadlimit/util.py | arielmakestuff/loadlimit | 70d3d23eecfe7922699098ea4901cc8673d14576 | [
"MIT"
] | null | null | null | loadlimit/util.py | arielmakestuff/loadlimit | 70d3d23eecfe7922699098ea4901cc8673d14576 | [
"MIT"
] | 5 | 2016-11-28T16:59:44.000Z | 2017-03-18T17:10:40.000Z | loadlimit/util.py | arielmakestuff/loadlimit | 70d3d23eecfe7922699098ea4901cc8673d14576 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# loadlimit/util.py
# Copyright (C) 2016 authors and contributors (see AUTHORS file)
#
# This module is released under the MIT License.
"""Utility objects and functions"""
# ============================================================================
# Imports
# ===============================... | 28.860577 | 79 | 0.479927 |
1c4179c2af86b60e626c745a4b3a99ddb5f6562c | 12,362 | py | Python | tests/test_functional_config.py | smilers/sabnzbd | ed0e5bbf9b963113f4962e7aec297266f19d6615 | [
"MIT",
"PSF-2.0",
"0BSD"
] | 1,354 | 2015-01-02T11:53:23.000Z | 2022-03-30T01:32:46.000Z | tests/test_functional_config.py | smilers/sabnzbd | ed0e5bbf9b963113f4962e7aec297266f19d6615 | [
"MIT",
"PSF-2.0",
"0BSD"
] | 1,742 | 2015-01-01T20:17:35.000Z | 2022-03-30T21:05:00.000Z | tests/test_functional_config.py | smilers/sabnzbd | ed0e5bbf9b963113f4962e7aec297266f19d6615 | [
"MIT",
"PSF-2.0",
"0BSD"
] | 410 | 2015-01-24T05:32:46.000Z | 2022-03-20T12:56:49.000Z | #!/usr/bin/python3 -OO
# Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... | 39.621795 | 119 | 0.653697 |
1c4206f4baef4d3380d19223d4bb597733644ce4 | 1,491 | py | Python | deepxde/maps/tensorflow/fnn.py | fabyayu/deepxde | 89880a4c61586512c87cabd1e7a3bdbaedf0feab | [
"Apache-2.0"
] | null | null | null | deepxde/maps/tensorflow/fnn.py | fabyayu/deepxde | 89880a4c61586512c87cabd1e7a3bdbaedf0feab | [
"Apache-2.0"
] | null | null | null | deepxde/maps/tensorflow/fnn.py | fabyayu/deepxde | 89880a4c61586512c87cabd1e7a3bdbaedf0feab | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .nn import NN
from .. import activations
from .. import initializers
from .. import regularizers
from ...backend import tf
class FNN(NN):
"""Fully-connected neural network."""
def __init__(
... | 29.82 | 78 | 0.593561 |
1c421b356518bf4c59535b3263ca030af4edeada | 3,562 | py | Python | im2txt/train.py | iamdebanjangoswami/Image-Caption-IR--Im2txt | e871cdd03c80fd70695ae5a46f32351e35956684 | [
"MIT"
] | 5 | 2018-07-17T16:10:02.000Z | 2018-07-17T21:53:37.000Z | im2txt/train.py | iamdebanjangoswami/Image-Caption-IR--Im2txt | e871cdd03c80fd70695ae5a46f32351e35956684 | [
"MIT"
] | null | null | null | im2txt/train.py | iamdebanjangoswami/Image-Caption-IR--Im2txt | e871cdd03c80fd70695ae5a46f32351e35956684 | [
"MIT"
] | null | null | null |
"""Train the model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from im2txt import configuration
from im2txt import show_and_tell_model
FLAGS = tf.app.flags.FLAGS
tf.flags.DEFINE_string("input_file_pattern", "",
... | 34.921569 | 80 | 0.71196 |
1c421c8fa09d98cc032788271130bc9b9f3fb194 | 17,010 | py | Python | tensorflow/contrib/distributions/python/ops/mixture.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | 1 | 2017-02-24T05:09:40.000Z | 2017-02-24T05:09:40.000Z | tensorflow/contrib/distributions/python/ops/mixture.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/distributions/python/ops/mixture.py | gnoses/TensorFlow | 63a21e054007d86269ed1ad0145ebce04ee57a81 | [
"Apache-2.0"
] | 1 | 2021-02-16T15:38:50.000Z | 2021-02-16T15:38:50.000Z | # Copyright 2016 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... | 42 | 80 | 0.671193 |
1c421d4c0b1c6e259ed2a537e534baf86c9bbbdc | 1,603 | py | Python | lib/matplotlib/tests/test_offsetbox.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/tests/test_offsetbox.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/tests/test_offsetbox.py | pmarshwx/matplotlib | 12be528dbf2114f7c25abf60de8100cb2d4494af | [
"MIT",
"BSD-3-Clause"
] | null | null | null | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import nose
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
from matplotlib.offsetbox import A... | 32.06 | 75 | 0.621335 |
1c4229d82360abfecb0c9b9eeb6d19c89a7b1ea2 | 468 | py | Python | touchpoint/employee.py | zappospizza/touchpoint-python | 19572c0c1360408dd980ed95e852046dcdba3623 | [
"MIT"
] | null | null | null | touchpoint/employee.py | zappospizza/touchpoint-python | 19572c0c1360408dd980ed95e852046dcdba3623 | [
"MIT"
] | null | null | null | touchpoint/employee.py | zappospizza/touchpoint-python | 19572c0c1360408dd980ed95e852046dcdba3623 | [
"MIT"
] | null | null | null | # touchpoint/employee.py
class Employee():
def __init__(self, employee_id, first_name=None, last_name=None, emp_id=None):
self.employee_id = employee_id
self.first_name = first_name
self.last_name = last_name
self.emp_id = emp_id
def info(self):
return {'employee_id': s... | 31.2 | 82 | 0.617521 |
1c4247727af42b6f5aaf853eecedbf57120e3803 | 2,415 | py | Python | checkmerge/analysis/report.py | jjkester/checkmerge | 23d1d9982cd7dc333b5748be3415e9b92f6576f4 | [
"Apache-2.0"
] | 1 | 2019-06-16T07:57:15.000Z | 2019-06-16T07:57:15.000Z | checkmerge/analysis/report.py | jjkester/checkmerge | 23d1d9982cd7dc333b5748be3415e9b92f6576f4 | [
"Apache-2.0"
] | null | null | null | checkmerge/analysis/report.py | jjkester/checkmerge | 23d1d9982cd7dc333b5748be3415e9b92f6576f4 | [
"Apache-2.0"
] | null | null | null | import collections
import itertools
import typing
from checkmerge import analysis, report
class AnalysisResultMaxSeverityMetric(report.Metric):
"""
Metric for the maximum analysis result severity within a type.
"""
name = 'Max. severity'
low = .5
high = 1.5
def __init__(self, items: typi... | 31.776316 | 111 | 0.677847 |
1c4286dc73c971e2e33bea18a4ca19da4a639cd8 | 16 | py | Python | btd6_memory_info/generated/System/Enum/enum.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Enum/enum.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Enum/enum.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class Enum: pass | 16 | 16 | 0.8125 |
1c428cd385440ea3c0ccbe81db1d5ce97b0ee4ef | 1,047 | py | Python | setup.py | cablelabs/snaps-orchestration | 0c55208e73e8ecd6c9e365215f931b5612a82ea9 | [
"Apache-2.0"
] | 1 | 2021-05-17T13:52:20.000Z | 2021-05-17T13:52:20.000Z | setup.py | cablelabs/snaps-common | d65764d19414510e93906da706afda2b6d2aa7fb | [
"Apache-2.0"
] | 10 | 2019-02-28T21:35:34.000Z | 2021-09-23T23:25:05.000Z | setup.py | cablelabs/snaps-orchestration | 0c55208e73e8ecd6c9e365215f931b5612a82ea9 | [
"Apache-2.0"
] | 1 | 2019-02-13T10:10:41.000Z | 2019-02-13T10:10:41.000Z | # Copyright (c) 2018 Cable Television Laboratories, Inc. ("CableLabs")
# and others. 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://w... | 36.103448 | 74 | 0.729704 |
1c42993e0f44f10aac7d85d890466a2f809cc09a | 19,246 | py | Python | salt/states/x509.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:49.000Z | 2020-10-19T11:49:49.000Z | salt/states/x509.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | salt/states/x509.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:50.000Z | 2020-10-19T11:49:50.000Z | # -*- coding: utf-8 -*-
'''
Manage X509 Certificates
.. versionadded:: Beryllium
This module can enable managing a complete PKI infrastructure including creating private keys, CA's,
certificates and CRLs. It includes the ability to generate a private key on a server, and have the
corresponding public key sent to a re... | 30.842949 | 114 | 0.593474 |
1c42c346b7d8ebd384f360f78261259aca83cf1f | 4,471 | py | Python | splitter/tracking/contour.py | splitter-research/splitter | 94e5e3073b4f383ba50397168ddb8bcd5fc48da4 | [
"MIT"
] | null | null | null | splitter/tracking/contour.py | splitter-research/splitter | 94e5e3073b4f383ba50397168ddb8bcd5fc48da4 | [
"MIT"
] | null | null | null | splitter/tracking/contour.py | splitter-research/splitter | 94e5e3073b4f383ba50397168ddb8bcd5fc48da4 | [
"MIT"
] | null | null | null | """This file is part of Splitter which is released under MIT License.
contour.py defines geometric vision primitives.
"""
from splitter.dataflow.map import Map
from timeit import default_timer as timer
import cv2
import numpy as np
class KeyPoints(Map):
"""KeyPoints uses a canny edge detector for identifying any ob... | 23.286458 | 92 | 0.634086 |
1c42e0fb6c6a8804f139a55a6b4ef4187901c5b6 | 11,946 | py | Python | rangeslicetools/utils.py | KOLANICH/rangeslicetools | 3111219b6ee52556483e5e6e260ba769b14e818b | [
"Unlicense"
] | null | null | null | rangeslicetools/utils.py | KOLANICH/rangeslicetools | 3111219b6ee52556483e5e6e260ba769b14e818b | [
"Unlicense"
] | null | null | null | rangeslicetools/utils.py | KOLANICH/rangeslicetools | 3111219b6ee52556483e5e6e260ba769b14e818b | [
"Unlicense"
] | null | null | null | import heapq
import itertools
import typing
from collections.abc import Sequence
from functools import wraps
__all__ = ("SliceRangeT", "SliceRangeTypeT", "SliceRangeSeqT", "SliceRangeListT", "sAny2Type", "range2slice", "slice2range", "slen", "sdir", "svec", "srev", "sdirect", "snormalize", "ssplit_1_", "ssplit_1", "ss... | 28.375297 | 399 | 0.720827 |
1c4311c385772f0780d0f5fd3ed496e89c9bb98c | 4,129 | py | Python | mmdet/models/losses/eqlv2.py | zhaohongyin/mmdetection-2.15 | 9fd29bfd373a6ad00674471c04ecc916f8ad413e | [
"Apache-2.0"
] | null | null | null | mmdet/models/losses/eqlv2.py | zhaohongyin/mmdetection-2.15 | 9fd29bfd373a6ad00674471c04ecc916f8ad413e | [
"Apache-2.0"
] | null | null | null | mmdet/models/losses/eqlv2.py | zhaohongyin/mmdetection-2.15 | 9fd29bfd373a6ad00674471c04ecc916f8ad413e | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.distributed as dist
from mmdet.utils import get_root_logger
from functools import partial
from ..builder import LOSSES
@LOSSES.register_module()
class EQLv2(nn.Module):
def __init__(self,
use_sigmoid=True,
... | 33.844262 | 83 | 0.578106 |
1c436014310567c0ee3904476243c19fb93b383e | 532 | py | Python | laterpay/constants.py | laterpay/laterpay-client-python | c75e13408f6900202108f52e386e1c8c719e5377 | [
"MIT"
] | 3 | 2015-09-16T13:32:41.000Z | 2015-09-16T15:10:20.000Z | laterpay/constants.py | laterpay/laterpay-client-python | c75e13408f6900202108f52e386e1c8c719e5377 | [
"MIT"
] | 81 | 2015-02-05T07:05:50.000Z | 2020-06-02T11:27:24.000Z | laterpay/constants.py | laterpay/laterpay-client-python | c75e13408f6900202108f52e386e1c8c719e5377 | [
"MIT"
] | 1 | 2016-12-14T12:26:38.000Z | 2016-12-14T12:26:38.000Z | EXPIRY_SECONDS_FOR_HOUR = 60 * 60
EXPIRY_SECONDS_FOR_DAY = 60 * 60 * 24
EXPIRY_SECONDS_FOR_WEEK = 60 * 60 * 24 * 7
EXPIRY_SECONDS_FOR_MONTH = 60 * 60 * 24 * 31
EXPIRY_SECONDS_FOR_YEAR = 60 * 60 * 24 * 365
EXPIRY_SECONDS_FOR_TIME_UNITS = {
'h': EXPIRY_SECONDS_FOR_HOUR,
'd': EXPIRY_SECONDS_FOR_DAY,
'w': EXPI... | 29.555556 | 46 | 0.75 |
1c43882de9d66e798e357004b8fcaf92f64aca83 | 1,357 | py | Python | psych_metric/datasets/crowd_layer/convert_txt_to_csv_ner.py | prijatelj/bayesian_eval_ground_truth-free | c0e569c78d63beb79f5e1e727c322293c3584323 | [
"MIT"
] | 1 | 2021-12-26T05:55:46.000Z | 2021-12-26T05:55:46.000Z | psych_metric/datasets/crowd_layer/convert_txt_to_csv_ner.py | prijatelj/bayesian_eval_ground_truth-free | c0e569c78d63beb79f5e1e727c322293c3584323 | [
"MIT"
] | null | null | null | psych_metric/datasets/crowd_layer/convert_txt_to_csv_ner.py | prijatelj/bayesian_eval_ground_truth-free | c0e569c78d63beb79f5e1e727c322293c3584323 | [
"MIT"
] | null | null | null | """Converts given data txt file into a more parsable formatted csv.
"""
import argparse
import numpy as np
import pandas as pd
def parse_args():
parser = argparse.ArgumentParser(description='Convert the given ner-mturk txt file into an easier to parse csv file.')
parser.add_argument('input_file', help='Enter... | 29.5 | 122 | 0.642594 |
1c43887a8bfb3ccc2eae3cbec1b04d408745a2bf | 4,850 | py | Python | cloudmersive_validate_api_client/models/validate_identifier_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | 3 | 2018-06-23T21:37:21.000Z | 2020-04-20T23:07:36.000Z | cloudmersive_validate_api_client/models/validate_identifier_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | 1 | 2019-02-04T17:03:35.000Z | 2019-03-02T20:16:52.000Z | cloudmersive_validate_api_client/models/validate_identifier_response.py | doc22940/cloudmersive.apiclient.python | 8646291f45ebd7c6572a296e30f693693a6782c4 | [
"Apache-2.0"
] | 2 | 2019-03-21T15:54:15.000Z | 2020-05-27T17:30:43.000Z | # coding: utf-8
"""
validateapi
The validation APIs help you validate data. Check if an E-mail address is real. Check if a domain is real. Check up on an IP address, and even where it is located. All this and much more is available in the validation API. # noqa: E501
OpenAPI spec version: v1
Ge... | 33.219178 | 274 | 0.610722 |
1c438f9a008ee3db85c82e845472932de6e679c6 | 2,660 | py | Python | bin/distribution_test.py | astrolabsoftware/fink-source | 9003e933e1d8c3f03b70c2b277638de97be102ec | [
"Apache-2.0"
] | 17 | 2019-03-08T12:37:06.000Z | 2022-02-01T18:02:07.000Z | bin/distribution_test.py | astrolabsoftware/fink-source | 9003e933e1d8c3f03b70c2b277638de97be102ec | [
"Apache-2.0"
] | 559 | 2019-03-07T14:55:27.000Z | 2022-03-11T20:13:12.000Z | bin/distribution_test.py | tallamjr/fink-broker | 97753ff695b78ea52d084cac787dec6c52c4e4cc | [
"Apache-2.0"
] | 12 | 2019-03-08T13:04:38.000Z | 2022-01-23T22:22:50.000Z | #!/usr/bin/env python
# Copyright 2019-2021 AstroLab Software
# Author: Abhishek Chauhan
#
# 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
#
#... | 31.666667 | 77 | 0.721805 |
1c4394dcae4611c54410c55300ddc06a3894fabe | 16,003 | py | Python | tests/scanner/test_win32_scanner.py | zea2/DeviceManager | 5f224c7680692cd9329b5b1421b00a814e3c2bfe | [
"MIT"
] | null | null | null | tests/scanner/test_win32_scanner.py | zea2/DeviceManager | 5f224c7680692cd9329b5b1421b00a814e3c2bfe | [
"MIT"
] | 15 | 2020-03-06T13:53:56.000Z | 2020-04-01T09:14:34.000Z | tests/scanner/test_win32_scanner.py | zea2/DeviceManager | 5f224c7680692cd9329b5b1421b00a814e3c2bfe | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script for testing the module device_manager.scanner._win32.
This script tests the following entities:
- class Win32USBDeviceScanner
- class Win32LANDeviceScanner
Authors:
Lukas Lankes, Forschungszentrum Jülich GmbH - ZEA-2, l.lankes@fz-juelich.de
"""
import os
im... | 49.544892 | 100 | 0.620509 |
1c43c2a3c540a69b7c7955a52ca5fcfac255bb4a | 488 | py | Python | DCNN-Pytorch/shape_testing.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | 11 | 2020-06-29T15:21:37.000Z | 2021-04-12T00:42:26.000Z | DCNN-Pytorch/shape_testing.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | null | null | null | DCNN-Pytorch/shape_testing.py | linklab-uva/deepracing | fc25c47658277df029e7399d295d97a75fe85216 | [
"Apache-2.0"
] | 4 | 2019-01-23T23:36:57.000Z | 2021-07-02T00:18:37.000Z | import torch
import deepracing_models.nn_models.Models as M
import time
#net = M.AdmiralNetKinematicPredictor(use_3dconv=False, sequence_length=20, context_length=5)
net = M.AdmiralNetCurvePredictor(use_3dconv=True, context_length=5, params_per_dimension=6)
net = net.cuda(0)
im = torch.rand(64,5,3,66,200)
im = im.cuda(... | 30.5 | 93 | 0.764344 |
1c43d13e1d7ae8c436ac089155e651917aefd88c | 5,603 | py | Python | Parser-hybrid/nparser/neural/models/nlp/parsers/gama_parser.py | sb-b/BOUN-PARSE | 2b529924897d8e2613c4d2193a67796a895da40b | [
"Apache-2.0"
] | 12 | 2020-03-04T17:36:12.000Z | 2021-09-26T14:02:49.000Z | Parser-hybrid/nparser/neural/models/nlp/parsers/gama_parser.py | sb-b/BOUN-PARSE | 2b529924897d8e2613c4d2193a67796a895da40b | [
"Apache-2.0"
] | 1 | 2020-12-09T08:21:11.000Z | 2020-12-09T08:21:11.000Z | Parser-hybrid/nparser/neural/models/nlp/parsers/gama_parser.py | sb-b/BOUN-PARSE | 2b529924897d8e2613c4d2193a67796a895da40b | [
"Apache-2.0"
] | 3 | 2020-11-18T09:53:42.000Z | 2020-12-17T23:04:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2016 Timothy Dozat
#
# 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 ... | 41.198529 | 164 | 0.622345 |
1c43d276031e9a7d2da6cf158bcba42ace6f10b4 | 1,256 | py | Python | hw2/mapper.py | venamax/ucb-261 | 7df292668a971f49f8a099d38f899e9961432e7c | [
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 1 | 2022-01-05T14:27:20.000Z | 2022-01-05T14:27:20.000Z | hw2/mapper.py | venamax/ucb-261 | 7df292668a971f49f8a099d38f899e9961432e7c | [
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | hw2/mapper.py | venamax/ucb-261 | 7df292668a971f49f8a099d38f899e9961432e7c | [
"MIT-0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
## mapper.py
## Author: Alejandro J. Rojas
## Description: mapper code for HW2.2
import sys
import re
from operator import itemgetter
counts = {}
for line in sys.stdin: ### input comes from STDIN (standard input)
record = re.split(r'\t+', line)
i... | 40.516129 | 102 | 0.454618 |
1c4433f0812e9b10a3f57fc23795522eae70a302 | 1,207 | py | Python | tempest/services/volume/json/admin/volume_services_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/services/volume/json/admin/volume_services_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/services/volume/json/admin/volume_services_client.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 NEC Corporation
# 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 ... | 32.621622 | 78 | 0.714996 |
1c443672071b863adb6d9fc4151f01406c3f4e08 | 1,165 | py | Python | funcstructs/prototypes/necklace_groups.py | caleblevy/endofunction-structures | 084ddeab8d12307dd95b8727190c589a1bf659df | [
"MIT"
] | 5 | 2015-05-06T05:08:26.000Z | 2017-04-21T03:32:13.000Z | funcstructs/prototypes/necklace_groups.py | caleblevy/endofunction-structures | 084ddeab8d12307dd95b8727190c589a1bf659df | [
"MIT"
] | null | null | null | funcstructs/prototypes/necklace_groups.py | caleblevy/endofunction-structures | 084ddeab8d12307dd95b8727190c589a1bf659df | [
"MIT"
] | null | null | null | """Caleb Levy, 2015."""
from funcstructs.structures import necklaces
from funcstructs import combinat
from . import polynomials, integer_partitions
def count_by_period(beads):
return necklaces.FixedContentNecklaces(beads).count_by_period()
def period_combos(beads, reps):
"""All possible combinations of pe... | 33.285714 | 78 | 0.744206 |
1c4460c9572f72b3583be0b06bb5fb540edd3e8f | 6,720 | py | Python | std/pytorch/02-mid/05.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | std/pytorch/02-mid/05.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | std/pytorch/02-mid/05.py | quantapix/qnarre.com | f51d5945c20ef8182c4aa11f1b407d064c190c70 | [
"MIT"
] | null | null | null | import gym
import math
import random
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from collections import namedtuple, deque
from itertools import count
from PIL import Image
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import torchvision.transfo... | 29.217391 | 94 | 0.67381 |
1c4488e1a483c60aa43bdc2ef73a7cb25713757e | 7,609 | py | Python | tf_agents/environments/atari_preprocessing.py | wookayin/tensorflow-agents | ae3751dfeed52422a350227047648dd82297960b | [
"Apache-2.0"
] | 2 | 2018-12-20T01:49:33.000Z | 2019-12-09T13:17:05.000Z | tf_agents/environments/atari_preprocessing.py | Akshay22121995/agents | 1455410dffed3cfdede793b87c179965cdd27d22 | [
"Apache-2.0"
] | null | null | null | tf_agents/environments/atari_preprocessing.py | Akshay22121995/agents | 1455410dffed3cfdede793b87c179965cdd27d22 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The TF-Agents 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... | 32.939394 | 80 | 0.697858 |
1c448dbcb82a77112b5b4abec69896d7f3d2a467 | 664 | py | Python | tests/pymath/test_expanded_form.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | tests/pymath/test_expanded_form.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | tests/pymath/test_expanded_form.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | import unittest
from pymath.expanded_form import expanded_form, expanded_form_2
class ExpandedFormTests(unittest.TestCase):
def test_12(self):
self.assertEqual("10 + 2", expanded_form(12))
def test_42(self):
self.assertEqual('40 + 2', expanded_form(42))
def test_70304(self):
se... | 26.56 | 67 | 0.683735 |
1c44a236c91b224f4e6cf8cf92d6dda93dbb02b4 | 341 | py | Python | lib/pool.py | Lufedi/reaper | bdf56b499e5b704c27b9f6c053d798c2a10fa4cf | [
"Apache-2.0"
] | 106 | 2015-07-21T16:18:26.000Z | 2022-03-31T06:45:34.000Z | lib/pool.py | Kowndinya2000/enhanced_repo_reaper | 744f794ba53bde5667b3b0f99b07273d0e32a495 | [
"Apache-2.0"
] | 21 | 2015-07-11T03:48:28.000Z | 2022-01-18T12:57:30.000Z | lib/pool.py | Kowndinya2000/enhanced_repo_reaper | 744f794ba53bde5667b3b0f99b07273d0e32a495 | [
"Apache-2.0"
] | 26 | 2015-07-22T22:38:21.000Z | 2022-03-14T10:11:56.000Z | import multiprocessing
import multiprocessing.pool
class NonDaemonicProcess(multiprocessing.Process):
def _get_daemon(self):
return False
def _set_daemon(self, value):
pass
daemon = property(_get_daemon, _set_daemon)
class NonDaemonicProcessPool(multiprocessing.pool.Pool):
Process ... | 20.058824 | 56 | 0.756598 |
1c44a23a3372712f8db5d46c920eaa64d7901173 | 621 | py | Python | download_skipthought.py | prakashpandey9/Text2Image-PyTorch | 1cafacdc284590c30c635e7e519a5acaabd4463c | [
"MIT"
] | 28 | 2018-11-25T18:40:33.000Z | 2021-07-30T03:17:29.000Z | download_skipthought.py | prakashpandey9/Text2Image-PyTorch | 1cafacdc284590c30c635e7e519a5acaabd4463c | [
"MIT"
] | 1 | 2019-07-22T15:28:33.000Z | 2019-07-22T15:28:33.000Z | download_skipthought.py | prakashpandey9/Text2Image-PyTorch | 1cafacdc284590c30c635e7e519a5acaabd4463c | [
"MIT"
] | 4 | 2020-04-18T08:48:33.000Z | 2021-04-15T10:00:36.000Z | import os
print ('Downloading Skip-Thought Model ...........')
os.sysytem('wget http://www.cs.toronto.edu/~rkiros/models/dictionary.txt')
os.sysytem('wget http://www.cs.toronto.edu/~rkiros/models/utable.npy')
os.sysytem('wget http://www.cs.toronto.edu/~rkiros/models/btable.npy')
os.sysytem('wget http://www.cs.toronto.... | 51.75 | 76 | 0.723027 |
1c44af7b481705d54dd67e7ed0c411ed35f66a39 | 9,372 | py | Python | docs/conf.py | MasterScott/pem | 9d910ab8b5d1b965ad696ddb19060d100dd6aba6 | [
"MIT"
] | 89 | 2015-01-31T20:54:34.000Z | 2022-03-09T08:24:43.000Z | docs/conf.py | MasterScott/pem | 9d910ab8b5d1b965ad696ddb19060d100dd6aba6 | [
"MIT"
] | 41 | 2015-01-13T14:46:20.000Z | 2021-04-07T15:01:29.000Z | docs/conf.py | MasterScott/pem | 9d910ab8b5d1b965ad696ddb19060d100dd6aba6 | [
"MIT"
] | 32 | 2015-01-09T20:45:11.000Z | 2021-04-23T13:30:54.000Z | # -*- coding: utf-8 -*-
#
# pem documentation build configuration file, created by
# sphinx-quickstart on Thu Jul 9 13:12:00 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | 31.662162 | 79 | 0.705079 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.