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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e8c3f872bb62de52e46ba35b410132d23e52f8bc | 3,756 | py | Python | Seeder/search_blob/models.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 8 | 2017-08-16T19:18:57.000Z | 2022-01-24T10:08:19.000Z | Seeder/search_blob/models.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 242 | 2017-02-03T19:15:52.000Z | 2022-03-25T08:02:52.000Z | Seeder/search_blob/models.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 2 | 2019-03-06T12:36:29.000Z | 2019-07-08T12:52:20.000Z | from django.db import models
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.paginator import EmptyPage, PageNotAnInteger
from django.db.models import Q
from paginator.paginator import CustomPaginator
from unidecode import un... | 30.536585 | 78 | 0.621672 |
e8c401dd0a88d998cdf1b80a7ffa313547bd032f | 5,698 | py | Python | infra/services/git_cookie_daemon/git_cookie_daemon.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | infra/services/git_cookie_daemon/git_cookie_daemon.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | infra/services/git_cookie_daemon/git_cookie_daemon.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 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.
"""Testable functions for Git_cookie_daemon."""
import argparse
import atexit
import cookielib
import functools
import logging
import logging.handlers
import... | 29.832461 | 82 | 0.661811 |
e8c402af2a46786b64feee099bc1eab337fd42f4 | 65 | py | Python | p14.py | cemulate/python-challenge | 1c3b790d3a32cd51b3bc9ed4d1acc2760405f358 | [
"MIT"
] | null | null | null | p14.py | cemulate/python-challenge | 1c3b790d3a32cd51b3bc9ed4d1acc2760405f358 | [
"MIT"
] | null | null | null | p14.py | cemulate/python-challenge | 1c3b790d3a32cd51b3bc9ed4d1acc2760405f358 | [
"MIT"
] | null | null | null | from extras import phonebookLookup
print phonebookLookup("Bert") | 21.666667 | 34 | 0.846154 |
e8c40c4d8a6a11d256c7de65be9346ebd9702923 | 3,641 | py | Python | lib/streamlit/elements/lib/dicttools.py | dwiel/streamlit | 74ae7f30cc3d95948aff311371449963f8eaf29e | [
"Apache-2.0"
] | 1 | 2020-01-04T06:45:37.000Z | 2020-01-04T06:45:37.000Z | lib/streamlit/elements/lib/dicttools.py | yutiansut/streamlit | 929942f755ca40f859a03d905ffcbf743f45dffa | [
"Apache-2.0"
] | 4 | 2021-05-09T11:42:18.000Z | 2022-02-27T10:59:36.000Z | lib/streamlit/elements/lib/dicttools.py | yutiansut/streamlit | 929942f755ca40f859a03d905ffcbf743f45dffa | [
"Apache-2.0"
] | 1 | 2020-06-26T14:41:01.000Z | 2020-06-26T14:41:01.000Z | # -*- coding: utf-8 -*-
# Copyright 2018-2019 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 24.938356 | 82 | 0.53694 |
e8c40cc989e49379d3bbdbf41025078285b99d42 | 6,661 | py | Python | src/python/tests/test_libs/untrusted_runner_helpers.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | src/python/tests/test_libs/untrusted_runner_helpers.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | src/python/tests/test_libs/untrusted_runner_helpers.py | fengjixuchui/clusterfuzz | ef89be3934936d1086b4a21bffca5506c8cb93be | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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, ... | 31.126168 | 79 | 0.712356 |
e8c4431f827a65473c7d3ca8d831fef7ccb8f8d3 | 11,426 | py | Python | ibmsecurity/isam/web/reverse_proxy/configuration/entry.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | 1 | 2018-04-24T19:57:09.000Z | 2018-04-24T19:57:09.000Z | ibmsecurity/isam/web/reverse_proxy/configuration/entry.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | null | null | null | ibmsecurity/isam/web/reverse_proxy/configuration/entry.py | ibm-enio/ibmsecurity | 81f989678642c3b6a49b2a3fbb5d9ca98804ef17 | [
"Apache-2.0"
] | 1 | 2020-04-03T09:30:01.000Z | 2020-04-03T09:30:01.000Z | import logging
import ibmsecurity.utilities.tools
logger = logging.getLogger(__name__)
# URI for this module
uri = "/wga/reverseproxy"
def get_all(isamAppliance, reverseproxy_id, stanza_id, check_mode=False, force=False):
"""
Retrieving all configuration entries for a stanza - Reverse Proxy
"""
try:... | 41.70073 | 120 | 0.571504 |
e8c44573a12ac0b793c6aba86e2319e07faed567 | 18,998 | py | Python | orphics/pixcov.py | msyriac/orphics | 9fddcda2621bcaed50d03f493656e40531635747 | [
"BSD-2-Clause"
] | 10 | 2018-01-12T16:12:11.000Z | 2021-02-11T18:46:47.000Z | orphics/pixcov.py | msyriac/orphics | 9fddcda2621bcaed50d03f493656e40531635747 | [
"BSD-2-Clause"
] | 20 | 2016-11-17T20:20:53.000Z | 2021-02-02T10:08:38.000Z | orphics/pixcov.py | msyriac/orphics | 9fddcda2621bcaed50d03f493656e40531635747 | [
"BSD-2-Clause"
] | 17 | 2017-04-28T23:28:16.000Z | 2021-08-15T20:28:25.000Z | from __future__ import print_function
import numpy as np
from pixell import enmap,utils
"""
Utilities that manipulate pixel-pixel covariance
matrices for small geometries.
Applications include:
1. fast brute force inpainting of circular holes
2. maximum-likelihood CMB halo lensing
"""
### ENMAP HELPER FUNCTIONS AND... | 37.545455 | 280 | 0.640015 |
e8c46142485ea34891e01a04bca44ee42e66b5d7 | 853 | py | Python | StaticImageStream.py | lilbowser/CamPS | 293a48160ac21a2ca04b291ce7c1e34ebcdec4a2 | [
"MIT"
] | null | null | null | StaticImageStream.py | lilbowser/CamPS | 293a48160ac21a2ca04b291ce7c1e34ebcdec4a2 | [
"MIT"
] | null | null | null | StaticImageStream.py | lilbowser/CamPS | 293a48160ac21a2ca04b291ce7c1e34ebcdec4a2 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015 Adrian Rosebrock, http://www.pyimagesearch.com
"""
# import the necessary packages
from threading import Thread
import cv2
class StaticImageStream:
"""
Testing class that loads a static img file
"""
def __init__(self, src=0):
self.frame = cv2.i... | 18.955556 | 71 | 0.616647 |
e8c469726f77b88114324c6ce07f173a085209a8 | 4,836 | py | Python | examples/tau_simulations/simple_network/runner.py | ucbtrans/sumo-project | a1232cfa6705d79313733ae118777a276536b088 | [
"BSD-2-Clause"
] | 5 | 2017-10-26T23:18:45.000Z | 2021-12-13T08:48:54.000Z | examples/tau_simulations/simple_network/runner.py | ucbtrans/sumo-project | a1232cfa6705d79313733ae118777a276536b088 | [
"BSD-2-Clause"
] | null | null | null | examples/tau_simulations/simple_network/runner.py | ucbtrans/sumo-project | a1232cfa6705d79313733ae118777a276536b088 | [
"BSD-2-Clause"
] | 3 | 2016-06-14T19:33:22.000Z | 2021-03-23T03:41:31.000Z | #!/usr/bin/env python
#@file runner.py
import os
import sys
import optparse
import subprocess
import random
import pdb
import matplotlib.pyplot as plt
import math
import numpy as np
import scipy.io
# import python modules from $SUMO_HOME/tools directory
try:
sys.path.append(os.path.join(os.path.dirname(os.path.r... | 34.297872 | 201 | 0.649297 |
e8c4971da7588ca0cd08099ba33608771a9b94d2 | 17,777 | py | Python | river/tree/hoeffding_tree.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 1,105 | 2019-01-24T15:15:30.000Z | 2020-11-10T18:27:00.000Z | river/tree/hoeffding_tree.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 328 | 2019-01-25T13:48:43.000Z | 2020-11-11T11:41:44.000Z | river/tree/hoeffding_tree.py | online-ml/creme | 60872844e6052b5ef20e4075aea30f9031377136 | [
"BSD-3-Clause"
] | 150 | 2019-01-29T19:05:21.000Z | 2020-11-11T11:50:14.000Z | import collections
import functools
import io
import math
import typing
from abc import ABC, abstractmethod
from river import base
from river.utils.skmultiflow_utils import (
calculate_object_size,
normalize_values_in_dict,
)
from .nodes.branch import (
DTBranch,
NominalBinaryBranch,
NominalMultiw... | 32.558608 | 97 | 0.582607 |
e8c499c31be06e68c15952ad0798b13d7ecda989 | 1,736 | py | Python | Fei_Yun_A01.py | febycloud/PROG8420 | 147b4877a33221b93c9a74f90819c397179f7332 | [
"MIT"
] | null | null | null | Fei_Yun_A01.py | febycloud/PROG8420 | 147b4877a33221b93c9a74f90819c397179f7332 | [
"MIT"
] | null | null | null | Fei_Yun_A01.py | febycloud/PROG8420 | 147b4877a33221b93c9a74f90819c397179f7332 | [
"MIT"
] | null | null | null | #The Course:PROG8420
#Assignment No:1
#Create date:2020/09/16
#Name: Fei Yun
#Write a module that prompts the user for an integer and then
#returns the factorial of that integer
#import math method
import math
#define a function for accept input and return factorial number
def givefactorial(str):
#try convert str... | 21.974684 | 63 | 0.705645 |
e8c4b473917ea5dea01cd554342b3cc9f69639c6 | 1,836 | py | Python | src/mixins.py | Plonq/liero-clone | 7b8db63e34de1b470cdb1d70874e20eab7319a29 | [
"MIT"
] | 1 | 2022-02-14T19:09:31.000Z | 2022-02-14T19:09:31.000Z | src/mixins.py | Plonq/liero-clone | 7b8db63e34de1b470cdb1d70874e20eab7319a29 | [
"MIT"
] | null | null | null | src/mixins.py | Plonq/liero-clone | 7b8db63e34de1b470cdb1d70874e20eab7319a29 | [
"MIT"
] | null | null | null | from pygame.math import Vector2
class ParticleCollisionMixin:
def collided_with_map(self, position, mask, game, previous_position=None):
def is_collided(pos):
int_pos = (int(-pos.x), int(-pos.y))
for game_mask in game.get_collision_masks(combined=False):
if mask.ove... | 35.307692 | 84 | 0.544662 |
e8c4caed952172d6a6dc97e99e6cb91a00ec03ff | 616 | py | Python | bflib/util.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | 3 | 2017-10-28T11:28:38.000Z | 2018-09-12T09:47:00.000Z | bflib/util.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | bflib/util.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | def max_if(value1, value2):
"""
Returns the largest value if it is not None
"""
if value1 and value2:
return max(value1, value2)
elif value1 is not None and value2 is None:
return value1
elif value1 is None and value2 is not None:
return value2
return None
def merg... | 22 | 47 | 0.61526 |
e8c4d494e897092f7e4c8789dbdbff279fecb7e2 | 1,331 | py | Python | Phase2/Code/dataset.py | mjoshi07/AutoPano | 1d60ac1c717ccdaae40c129959fed5a27533d225 | [
"MIT"
] | null | null | null | Phase2/Code/dataset.py | mjoshi07/AutoPano | 1d60ac1c717ccdaae40c129959fed5a27533d225 | [
"MIT"
] | null | null | null | Phase2/Code/dataset.py | mjoshi07/AutoPano | 1d60ac1c717ccdaae40c129959fed5a27533d225 | [
"MIT"
] | null | null | null | """
CMSC733 Spring 2022: Classical and Deep Learning Approaches for Geometric Computer Vision
Project1: MyAutoPano: Phase 2
Author(s):
Mayank Joshi
Masters student in Robotics,
University of Maryland, College Park
Adithya Gaurav Singh
Masters student in Robotics,
University of Maryland, College Park
"""
import numpy... | 30.25 | 94 | 0.712998 |
e8c4ee76538841ccae807c97c87739f4fbbc9aa8 | 14,115 | py | Python | intersight/models/sdcard_policy.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/sdcard_policy.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/sdcard_policy.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class SdcardPolicy(object):
"""
NOTE: This class is... | 27.249035 | 259 | 0.58576 |
e8c4fcb9913e4b5ff77d2c01aefed371856a2afc | 18,185 | py | Python | slate/node.py | Axelware/slate | 241f782d9109b626ca068bfe439d1970f1663166 | [
"MIT"
] | 3 | 2021-10-30T12:39:12.000Z | 2022-03-28T11:30:40.000Z | slate/node.py | Axelware/slate | 241f782d9109b626ca068bfe439d1970f1663166 | [
"MIT"
] | 1 | 2021-12-08T16:20:15.000Z | 2021-12-08T16:20:15.000Z | slate/node.py | Axelware/slate | 241f782d9109b626ca068bfe439d1970f1663166 | [
"MIT"
] | 3 | 2021-10-18T14:20:18.000Z | 2022-01-28T11:51:41.000Z | # Future
from __future__ import annotations
# Standard Library
import asyncio
import json
import logging
from typing import Any, Generic, Literal
# Packages
import aiohttp
import spotipy
# Local
from .exceptions import (
HTTPError,
InvalidNodePassword,
NodeConnectionError,
NodeNotConnected,
NoRes... | 33.244973 | 154 | 0.561342 |
e8c54b27e7cd2990df205e6e494e9f571d5c17bf | 28,007 | py | Python | packages/main/src/RPA/Cloud/Azure.py | pavelee/rpaframework | 30bf09eb7a3bb3b22f596690791013e0ff2f7b73 | [
"Apache-2.0"
] | null | null | null | packages/main/src/RPA/Cloud/Azure.py | pavelee/rpaframework | 30bf09eb7a3bb3b22f596690791013e0ff2f7b73 | [
"Apache-2.0"
] | null | null | null | packages/main/src/RPA/Cloud/Azure.py | pavelee/rpaframework | 30bf09eb7a3bb3b22f596690791013e0ff2f7b73 | [
"Apache-2.0"
] | null | null | null | import json
import logging
import os
import time
from typing import Any
import requests
from RPA.Robocloud.Secrets import Secrets
DEFAULT_REGION = "northeurope"
class AzureBase:
"""Base class for all Azure servives.
`TOKEN_LIFESPAN` is in seconds, token is valid for 10 minutes so max lifetime
is set to... | 37.342667 | 153 | 0.620773 |
e8c56316ff5d87b0ef64cdc25db0c731179823b1 | 171 | py | Python | api/tests/ver2/test_data/office_test_data.py | pcf26536/politico-api | 1c9b8755ddad2baf0bfdeab4aa0674e4197a0d7c | [
"MIT"
] | 1 | 2019-02-22T19:34:32.000Z | 2019-02-22T19:34:32.000Z | api/tests/ver2/test_data/office_test_data.py | pcf26536/politico-api | 1c9b8755ddad2baf0bfdeab4aa0674e4197a0d7c | [
"MIT"
] | null | null | null | api/tests/ver2/test_data/office_test_data.py | pcf26536/politico-api | 1c9b8755ddad2baf0bfdeab4aa0674e4197a0d7c | [
"MIT"
] | 1 | 2019-02-07T22:12:25.000Z | 2019-02-07T22:12:25.000Z | from api.strings import name_key, type_key
from api.ver1.offices.strings import fed_type
correct_office = {
name_key: "Women Representative",
type_key: fed_type
} | 24.428571 | 45 | 0.77193 |
e8c56c7c77be6b7aa3c1de7e6a5dfabf962a1b6d | 344 | py | Python | config.py | luxep/pinterest-telegram-bot | 6837d06cbd3a94e0038c26dd38ce0268709c9db9 | [
"MIT"
] | null | null | null | config.py | luxep/pinterest-telegram-bot | 6837d06cbd3a94e0038c26dd38ce0268709c9db9 | [
"MIT"
] | null | null | null | config.py | luxep/pinterest-telegram-bot | 6837d06cbd3a94e0038c26dd38ce0268709c9db9 | [
"MIT"
] | null | null | null | import os
HEADERS = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"
}
TOKEN = os.environ.get("1869784108:AAF1YEXY8KrnaiL27XAWie_6K1gHqx590iU")
WEBHOOK_URL = os.environ.get("https://rotardayi.herokuapp.com")
REDIS_URL = os.e... | 38.222222 | 141 | 0.75 |
e8c57b67effea816e3f689826d777312738f3f33 | 1,328 | py | Python | test/test_v0_command_request_status.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | test/test_v0_command_request_status.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | test/test_v0_command_request_status.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Esper APIs
OpenAPI spec version: 1.0.0
Contact: developer@esper.io
---------------------------------------------------------
Copyright 2019 Shoonya Enterprises Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Yo... | 25.056604 | 85 | 0.729669 |
e8c57ceb0cfa8dec62e7a085db8dc46cbc099c60 | 1,432 | py | Python | coloursite/wsgi.py | richbs/colourlens | 1f5600ad6feb08ffc5b405826ebf21642fdd0475 | [
"MIT"
] | 2 | 2016-01-05T16:31:16.000Z | 2020-06-26T12:12:59.000Z | coloursite/wsgi.py | richbs/colourlens | 1f5600ad6feb08ffc5b405826ebf21642fdd0475 | [
"MIT"
] | null | null | null | coloursite/wsgi.py | richbs/colourlens | 1f5600ad6feb08ffc5b405826ebf21642fdd0475 | [
"MIT"
] | 1 | 2021-04-30T10:01:07.000Z | 2021-04-30T10:01:07.000Z | """
WSGI config for coloursite project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION... | 42.117647 | 79 | 0.803771 |
e8c592b9a4dcf85157740999e7670477f759c9be | 8,542 | py | Python | geoopt/manifolds/symmetric_positive_definite.py | tao-harald/geoopt | d6fea4d44f146877c5a430e9fd6ba0fb7e821b92 | [
"Apache-2.0"
] | null | null | null | geoopt/manifolds/symmetric_positive_definite.py | tao-harald/geoopt | d6fea4d44f146877c5a430e9fd6ba0fb7e821b92 | [
"Apache-2.0"
] | null | null | null | geoopt/manifolds/symmetric_positive_definite.py | tao-harald/geoopt | d6fea4d44f146877c5a430e9fd6ba0fb7e821b92 | [
"Apache-2.0"
] | null | null | null | from typing import Optional, Tuple, Union
import torch
from .base import Manifold
from ..linalg import batch_linalg
__all__ = ["SymmetricPositiveDefinite"]
EPS = {torch.float32: 1e-4, torch.float64: 1e-7}
class SymmetricPositiveDefinite(Manifold):
r"""Manifold of symmetric positive definite matrices.
.. m... | 30.183746 | 105 | 0.563451 |
e8c5a270916e98ed17ed49326cf9905947b351e0 | 13,633 | py | Python | ethereum/tester.py | isaiahgenis/Ethereum-Python | 295975d393be3b74f7bd7dc89ce45f9d973e225a | [
"MIT"
] | null | null | null | ethereum/tester.py | isaiahgenis/Ethereum-Python | 295975d393be3b74f7bd7dc89ce45f9d973e225a | [
"MIT"
] | null | null | null | ethereum/tester.py | isaiahgenis/Ethereum-Python | 295975d393be3b74f7bd7dc89ce45f9d973e225a | [
"MIT"
] | 1 | 2022-02-09T03:34:05.000Z | 2022-02-09T03:34:05.000Z | # -*- coding: utf8 -*-
import shutil
import tempfile
import time
import types
import warnings
import rlp
from rlp.utils import ascii_chr
from ethereum import blocks, db, opcodes, processblock, transactions
from ethereum.abi import ContractTranslator
from ethereum.config import Env
from ethereum.slogging import LogRec... | 32.536993 | 126 | 0.605003 |
e8c5d0507edcc080de564b7ac5bec005c1d4f18a | 1,287 | py | Python | quizzes/migrations/0003_auto_20200826_1516.py | aeronlroach/django-quiz | 96c0965138d56e8d3b335edb6d6b7c3f67753031 | [
"MIT"
] | null | null | null | quizzes/migrations/0003_auto_20200826_1516.py | aeronlroach/django-quiz | 96c0965138d56e8d3b335edb6d6b7c3f67753031 | [
"MIT"
] | null | null | null | quizzes/migrations/0003_auto_20200826_1516.py | aeronlroach/django-quiz | 96c0965138d56e8d3b335edb6d6b7c3f67753031 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-08-26 22:16
from django.db import migrations, models
import django.db.models.deletion
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('quizzes', '0002_quiz_active_quiz'),
]
operations = [
migrations.AlterField(
... | 33 | 138 | 0.583528 |
e8c5e892fbc68d47a03b9a972f3a00996aa9e0aa | 13,365 | py | Python | code/toscaparser/topology_template.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | 8 | 2017-03-13T16:34:28.000Z | 2021-11-16T11:35:56.000Z | code/toscaparser/topology_template.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | null | null | null | code/toscaparser/topology_template.py | superfluidity/RDCL3D | 3c5717941bd4046aa1be178e9004db1dc1c469a0 | [
"Apache-2.0"
] | 3 | 2017-03-28T09:26:40.000Z | 2020-12-08T14:16:12.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
# d... | 43.252427 | 78 | 0.555181 |
e8c5fad944b83c2c6f2af2912199ac4052b60f60 | 154 | py | Python | apps/bot/data/config.py | FrozRt/marmon_back | ec58b6d8fcc81d13a841efb84bde5914fd316787 | [
"MIT"
] | null | null | null | apps/bot/data/config.py | FrozRt/marmon_back | ec58b6d8fcc81d13a841efb84bde5914fd316787 | [
"MIT"
] | 45 | 2021-03-12T02:20:24.000Z | 2021-07-26T02:46:11.000Z | apps/bot/data/config.py | FrozRt/marmon_back | ec58b6d8fcc81d13a841efb84bde5914fd316787 | [
"MIT"
] | null | null | null | import os
from dotenv import load_dotenv
load_dotenv()
API_TOKEN = os.getenv("TELEGRAM_API_TOKEN")
admins = [os.getenv("ADMIN1"), os.getenv("ADMIN2")] | 17.111111 | 51 | 0.746753 |
e8c654b5b09608ba9a35b62cda682550f3dc6863 | 40,483 | py | Python | pyglet/gl/glxext_arb.py | regular/pyglet-avbin-optimizations | e93c0508a57c92c24cc22dee12be0a58b1fcf975 | [
"BSD-3-Clause"
] | 2 | 2017-05-10T08:27:22.000Z | 2019-10-05T14:55:00.000Z | pyglet/gl/glxext_arb.py | regular/pyglet-avbin-optimizations | e93c0508a57c92c24cc22dee12be0a58b1fcf975 | [
"BSD-3-Clause"
] | null | null | null | pyglet/gl/glxext_arb.py | regular/pyglet-avbin-optimizations | e93c0508a57c92c24cc22dee12be0a58b1fcf975 | [
"BSD-3-Clause"
] | null | null | null | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | 50.540574 | 197 | 0.7805 |
e8c66f9e159eadd238308a549814ca1cc4f7ba67 | 1,754 | py | Python | noxfile.py | boatx/SockIt | 08ab720eddd520caeb73371323fbc298f53a6d6f | [
"MIT"
] | null | null | null | noxfile.py | boatx/SockIt | 08ab720eddd520caeb73371323fbc298f53a6d6f | [
"MIT"
] | null | null | null | noxfile.py | boatx/SockIt | 08ab720eddd520caeb73371323fbc298f53a6d6f | [
"MIT"
] | null | null | null | import tempfile
from typing import Any
import nox
from nox.sessions import Session
PYTHON_VERSIONS = ("3.8", "3.7", "3.6")
LOCATIONS = ("noxfile.py", "tests", "sockit")
nox.options.sessions = ("lint", "mypy", "pytype", "tests")
def install_with_constraints(
session: Session, *args: str, **kwargs: Any
) -> None... | 27.40625 | 79 | 0.631699 |
e8c69752eb776a01cfab1d23bb16e8ab6e5ff3e3 | 2,295 | py | Python | API/src/main/resources/Lib/robot/utils/dotdict.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/utils/dotdict.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/robot/utils/dotdict.py | TagExpress/SikuliX1 | de9da11794dd94b3821eddc5c01b534d3f2fe828 | [
"MIT"
] | null | null | null | # Copyright (c) 2010-2020, sikuli.org, sikulix.com - MIT license
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 32.785714 | 78 | 0.65098 |
e8c6a7bb0d791e37e1dc30c06ba15f3bcf4fcddb | 4,243 | py | Python | pushservices/fcm.py | ypshukla/airnotifier | b9096d83bcc4d2661cef59afff97929c2f378f11 | [
"BSD-3-Clause"
] | null | null | null | pushservices/fcm.py | ypshukla/airnotifier | b9096d83bcc4d2661cef59afff97929c2f378f11 | [
"BSD-3-Clause"
] | null | null | null | pushservices/fcm.py | ypshukla/airnotifier | b9096d83bcc4d2661cef59afff97929c2f378f11 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import requests
from . import PushService
import json
import time
from util import strip_tags
import logging
from oauth2client.service_account import ServiceAccountCredentials
BASE_URL = "https://fcm.googleapis.com"
SCOPES = ["https://www.googleapis.com/auth/f... | 30.092199 | 98 | 0.570351 |
e8c6ccedd8d6c606f6efe315cf8986f4352e7a38 | 12,904 | py | Python | upacket-python/uPacket.py | bryant-saunders/uPacket | 2cad160c9dca4cd61ad9c1c0c71e4fa36010228d | [
"MIT"
] | 2 | 2022-01-03T14:13:03.000Z | 2022-01-07T01:54:25.000Z | upacket-python/uPacket.py | bryant-saunders/uPacket | 2cad160c9dca4cd61ad9c1c0c71e4fa36010228d | [
"MIT"
] | null | null | null | upacket-python/uPacket.py | bryant-saunders/uPacket | 2cad160c9dca4cd61ad9c1c0c71e4fa36010228d | [
"MIT"
] | null | null | null | import serial
import socket
import serial.tools.list_ports
from time import sleep
import struct
class up():
"""
uPacket object used to communicate with a controller implementing
the uPacket protocol. Connections can be made via serial port or by
TCP network on supported controllers(ESP8266, ESP32...)
... | 31.320388 | 88 | 0.526658 |
e8c6d6bdc7bf8a56c83fe12a57d6182b0805477b | 782 | py | Python | example/migrations/0001_initial.py | 20tab/django-political-map | ca43fd492e65450b063a67580978e9a8e86c7b08 | [
"MIT"
] | 9 | 2017-02-24T20:01:11.000Z | 2021-07-20T09:35:55.000Z | example/migrations/0001_initial.py | 20tab/django-political-map | ca43fd492e65450b063a67580978e9a8e86c7b08 | [
"MIT"
] | 9 | 2017-03-01T18:34:01.000Z | 2021-06-01T22:01:23.000Z | example/migrations/0001_initial.py | 20tab/django-political-map | ca43fd492e65450b063a67580978e9a8e86c7b08 | [
"MIT"
] | 4 | 2017-03-01T10:29:46.000Z | 2019-09-29T01:31:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-21 00:27
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
import politicalplaces.fields
class Migration(migrations.Migration):
initial = True
dependencies = [
('political... | 28.962963 | 167 | 0.657289 |
e8c6e1acf80f0791421bee59aff30e67bccb44b2 | 1,263 | py | Python | tensorflow/contrib/learn/python/learn/preprocessing/__init__.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 848 | 2019-12-03T00:16:17.000Z | 2022-03-31T22:53:17.000Z | tensorflow/contrib/learn/python/learn/preprocessing/__init__.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 656 | 2019-12-03T00:48:46.000Z | 2022-03-31T18:41:54.000Z | tensorflow/contrib/learn/python/learn/preprocessing/__init__.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 506 | 2019-12-03T00:46:26.000Z | 2022-03-30T10:34:56.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... | 40.741935 | 93 | 0.742676 |
e8c6e2a5130196a3023362eb39beb2feb9ff5ed8 | 1,317 | py | Python | data/level/level10237.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | null | null | null | data/level/level10237.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 6 | 2020-07-04T02:53:08.000Z | 2022-03-11T23:53:14.000Z | data/level/level10237.py | levelupai/match3-level-similarity | cc9b28b8741b41bea1273c8bc9b4d265d79a1dca | [
"Apache-2.0"
] | 3 | 2019-12-31T11:42:59.000Z | 2021-03-28T20:06:13.000Z | data = {'level_index': 10237, 'move_count': '26',
'board_info': {(-1, 5): {}, (-1, 4): {}, (-1, 3): {}, (-1, 2): {}, (-1, 1): {'base': (1, 1)},
(-1, 0): {'fall_point': (0, -1)}, (0, 5): {}, (0, 4): {}, (0, 3): {}, (0, 2): {'base': (1, 1)},
(0, 1): {}, (0, 0): {'base... | 101.307692 | 119 | 0.208049 |
e8c6fc7c5413257ec667d90ae647dd0f5ce9e8bb | 33,204 | py | Python | applications/popart/resnext_inference/dataloader.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | applications/popart/resnext_inference/dataloader.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | applications/popart/resnext_inference/dataloader.py | Splendon/examples | ed4a8a01857b6ddca49559141acf5d0986eb01e1 | [
"MIT"
] | null | null | null | # Copyright 2019 Graphcore Ltd.
import random
import torch
import signal
import functools
import re
import sys
import threading
import traceback
import os
import time
import atexit
from functools import partial
import popart
IS_WINDOWS = sys.platform == "win32"
if IS_WINDOWS:
import ctypes
from ctypes.wintypes... | 41.505 | 117 | 0.598452 |
e8c703288292de1efc9895c0a4a62a6868f04908 | 1,345 | py | Python | models.py | abhishek-nigam/raindrop-backup-bookmarks | 2ba87c90d0585d9fffcfdf04c3996232aab9a593 | [
"MIT"
] | 2 | 2020-12-01T06:56:20.000Z | 2020-12-24T21:12:36.000Z | models.py | abhishek-nigam/raindrop-backup-bookmarks | 2ba87c90d0585d9fffcfdf04c3996232aab9a593 | [
"MIT"
] | null | null | null | models.py | abhishek-nigam/raindrop-backup-bookmarks | 2ba87c90d0585d9fffcfdf04c3996232aab9a593 | [
"MIT"
] | null | null | null | from typing import List
class Tag:
'''
Model for tag
'''
def __init__(self, _id: str) -> None:
self._id = _id
def __str__(self) -> str:
return f"Tag({self._id})"
def __repr__(self) -> str:
return f"Tag({self._id})"
class BookmarkTagMapping:
'''
Model... | 26.372549 | 151 | 0.601487 |
e8c70e8c2866b2e1b53a2dddc157ee11cd91a81e | 1,588 | py | Python | djbootstrap/tests.py | madisona/djbootstrap | 812f3b3d50140fbb859b59914c4737879021c94d | [
"Apache-2.0"
] | null | null | null | djbootstrap/tests.py | madisona/djbootstrap | 812f3b3d50140fbb859b59914c4737879021c94d | [
"Apache-2.0"
] | null | null | null | djbootstrap/tests.py | madisona/djbootstrap | 812f3b3d50140fbb859b59914c4737879021c94d | [
"Apache-2.0"
] | null | null | null |
from django import forms
from django import template
from django import test
from djbootstrap.templatetags.bootstrap_tags import activate, bootstrapped_form
class ActivateTemplateTagTests(test.TestCase):
def test_returns_active_when_request_is_same_path(self):
t = template.Template("""
{% lo... | 32.408163 | 92 | 0.653023 |
e8c78d01cae7599d98df0ce86eb4a7318f7b331f | 5,068 | py | Python | sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_managed_rule_sets_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_managed_rule_sets_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/cdn/azure-mgmt-cdn/azure/mgmt/cdn/aio/operations/_managed_rule_sets_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"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 ... | 44.45614 | 143 | 0.674625 |
e8c7a43da824dd70db836d308b67cb23a4a62f95 | 18,544 | py | Python | mbrl/models/model.py | MarkSelden/mbrl-lib | 26845b3a5d8930e00726cc56bf17707a7ac45083 | [
"MIT"
] | null | null | null | mbrl/models/model.py | MarkSelden/mbrl-lib | 26845b3a5d8930e00726cc56bf17707a7ac45083 | [
"MIT"
] | null | null | null | mbrl/models/model.py | MarkSelden/mbrl-lib | 26845b3a5d8930e00726cc56bf17707a7ac45083 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import abc
import pathlib
from typing import Any, Dict, Optional, Sequence, Tuple, Union
import torch
from torch import n... | 38.87631 | 99 | 0.604346 |
e8c7b1646bdcc8746849866726c5fc6ef9dcebde | 1,099 | py | Python | checkov/terraform/module_loading/loaders/git_loader.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | null | null | null | checkov/terraform/module_loading/loaders/git_loader.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | 3 | 2020-02-07T19:51:40.000Z | 2022-03-21T05:06:29.000Z | checkov/terraform/module_loading/loaders/git_loader.py | graybrandonpfg/checkov | 3081a8560f6369465314ee8f4ac8a8ec01649d68 | [
"Apache-2.0"
] | null | null | null | import os
from checkov.common.goget.github.get_git import GitGetter
from checkov.terraform.module_loading.content import ModuleContent
from checkov.terraform.module_loading.loader import ModuleLoader
class GenericGitLoader(ModuleLoader):
def _is_matching_loader(self):
# https://www.terraform.io/docs/mod... | 37.896552 | 85 | 0.703367 |
e8c7d664e5cb28d7451e0fd93a948cb08fce368e | 5,080 | py | Python | login_ctrl.py | lastcc/OAHelper | 2d58ac56b8e223aeefd5371d3eaf9ea8ac485735 | [
"MIT"
] | null | null | null | login_ctrl.py | lastcc/OAHelper | 2d58ac56b8e223aeefd5371d3eaf9ea8ac485735 | [
"MIT"
] | null | null | null | login_ctrl.py | lastcc/OAHelper | 2d58ac56b8e223aeefd5371d3eaf9ea8ac485735 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import time
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
from selenium.webdriver.support import expected_conditions as EC
import cookielib
from tinyhttp import Firef... | 28.379888 | 97 | 0.632283 |
e8c7ed373906f35871914b965e01e38520a729be | 619 | py | Python | test/rules/test_poisoning_adult.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-23T12:57:47.000Z | 2020-04-18T17:13:08.000Z | test/rules/test_poisoning_adult.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 4 | 2019-01-09T22:10:07.000Z | 2022-02-16T04:57:06.000Z | test/rules/test_poisoning_adult.py | rileyhazard/SmartVA-Analyze-1 | 0573eeff27d03f54e7506db4f1631c0cd9f54bbb | [
"MIT"
] | 11 | 2018-12-11T22:01:13.000Z | 2022-01-07T11:38:02.000Z | from smartva.rules import poisoning_adult as poisoning
from smartva.data.constants import *
VA = Adult
def test_pass():
row = {
VA.POISONING: YES,
VA.INJURY_DAYS: 0,
}
assert poisoning.logic_rule(row) is True
def test_fail_poisoning():
row = {
VA.POISONING: NO,
VA.I... | 16.289474 | 54 | 0.631664 |
e8c83d8d1d7918c564cbbf1499927b0a8d499307 | 84,535 | py | Python | 1.0.0/hp/plot2.py | cefect/SOFDA0 | 62c5566d0f388a5fd76a070ceb5ee3e38b0d7463 | [
"MIT"
] | null | null | null | 1.0.0/hp/plot2.py | cefect/SOFDA0 | 62c5566d0f388a5fd76a070ceb5ee3e38b0d7463 | [
"MIT"
] | null | null | null | 1.0.0/hp/plot2.py | cefect/SOFDA0 | 62c5566d0f388a5fd76a070ceb5ee3e38b0d7463 | [
"MIT"
] | null | null | null | '''
Created on Sep 15, 2018
@author: cef
generic plotting functions
'''
#===============================================================================
# # IMPORTS --------------------------------------------------------------------
#========================================================================... | 36.110636 | 122 | 0.381712 |
e8c8766faa8f1ed06b103554c54beb9cb78ff432 | 3,942 | py | Python | ml-agents-dev/mlagentsdev/trainers/bc/policy.py | vkakerbeck/ml-agents-dev | e3a52b5787af06c07fbd945e2ac37bb3bf07ce0c | [
"Apache-2.0"
] | null | null | null | ml-agents-dev/mlagentsdev/trainers/bc/policy.py | vkakerbeck/ml-agents-dev | e3a52b5787af06c07fbd945e2ac37bb3bf07ce0c | [
"Apache-2.0"
] | null | null | null | ml-agents-dev/mlagentsdev/trainers/bc/policy.py | vkakerbeck/ml-agents-dev | e3a52b5787af06c07fbd945e2ac37bb3bf07ce0c | [
"Apache-2.0"
] | null | null | null | import logging
import numpy as np
from mlagentsdev.trainers.bc.models import BehavioralCloningModel
from mlagentsdev.trainers.policy import Policy
logger = logging.getLogger("mlagentsdev.trainers")
class BCPolicy(Policy):
def __init__(self, seed, brain, trainer_parameters, load):
"""
:param seed... | 41.93617 | 85 | 0.620244 |
e8c8b2c811312463bca134c70761f8712ed41b1f | 2,010 | py | Python | src/archives/grid_archive.py | icaros-usc/dqd-rl | 83e3da62df37b45c4b8fc549c07f566797b5f685 | [
"MIT"
] | 6 | 2022-02-09T05:35:37.000Z | 2022-03-12T11:54:59.000Z | src/archives/grid_archive.py | icaros-usc/dqd-rl | 83e3da62df37b45c4b8fc549c07f566797b5f685 | [
"MIT"
] | null | null | null | src/archives/grid_archive.py | icaros-usc/dqd-rl | 83e3da62df37b45c4b8fc549c07f566797b5f685 | [
"MIT"
] | null | null | null | """Custom GridArchive."""
import gin
import numpy as np
import ribs.archives
from ribs.archives._archive_base import readonly
@gin.configurable
class GridArchive(ribs.archives.GridArchive):
"""Based on pyribs GridArchive.
This archive records history of its objectives and behavior values if
record_histor... | 32.95082 | 77 | 0.629851 |
e8c8c4633bb50c8b37618a0ed9f61357d8404e18 | 390 | py | Python | Main_plot_chemprop_models_and_violins.py | PV-Lab/MLforCOE | 6aa751afe4baaeec75c8e5bdae52220c896a5fae | [
"BSD-2-Clause"
] | 2 | 2021-11-24T06:27:02.000Z | 2021-12-02T11:26:03.000Z | Main_plot_chemprop_models_and_violins.py | PV-Lab/MLforCOE | 6aa751afe4baaeec75c8e5bdae52220c896a5fae | [
"BSD-2-Clause"
] | 1 | 2021-11-26T17:58:27.000Z | 2021-12-02T02:12:16.000Z | Main_plot_chemprop_models_and_violins.py | PV-Lab/MLforCOE | 6aa751afe4baaeec75c8e5bdae52220c896a5fae | [
"BSD-2-Clause"
] | 2 | 2022-01-05T03:23:00.000Z | 2022-02-16T05:08:48.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 8 16:06:47 2021
Plot and analyze chemprop models and create violin plots of all the models. These codes have not been tidied.
@author: armi
"""
import chemprop_models_stratsplit.Plot_results # Plot DMPNN and ffNN test and newdata predictions.
im... | 27.857143 | 109 | 0.766667 |
e8c8d03be66488dc34ffae85659f09e3dbebf06a | 2,629 | py | Python | tasks/gem5art/tasks/tasks.py | darchr/gem5art | 4a0f47d1103ff68883bb0707cd888c6ac9ade775 | [
"BSD-3-Clause"
] | 19 | 2020-02-05T08:26:30.000Z | 2022-03-04T09:08:37.000Z | tasks/gem5art/tasks/tasks.py | darchr/gem5art | 4a0f47d1103ff68883bb0707cd888c6ac9ade775 | [
"BSD-3-Clause"
] | 93 | 2019-10-28T22:17:25.000Z | 2021-07-01T10:20:28.000Z | tasks/gem5art/tasks/tasks.py | darchr/gem5art | 4a0f47d1103ff68883bb0707cd888c6ac9ade775 | [
"BSD-3-Clause"
] | 15 | 2020-02-05T09:30:19.000Z | 2021-07-29T04:50:46.000Z | # Copyright (c) 2019 The Regents of the University of California
# All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this lis... | 43.816667 | 104 | 0.748954 |
e8c8de3f71972675fc0f52ba569882e595b0cdee | 17,600 | py | Python | tempest/api/network/base.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/network/base.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/network/base.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# 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 requ... | 39.111111 | 79 | 0.603352 |
e8c9862a19d41f7897353e3c704d6b2ca8b162ce | 2,739 | py | Python | kits/valids.py | Elaoed/iplives | 6b27fe929b6d605efc70b5cfb7a0c7609100f0ff | [
"BSD-3-Clause"
] | null | null | null | kits/valids.py | Elaoed/iplives | 6b27fe929b6d605efc70b5cfb7a0c7609100f0ff | [
"BSD-3-Clause"
] | null | null | null | kits/valids.py | Elaoed/iplives | 6b27fe929b6d605efc70b5cfb7a0c7609100f0ff | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Various valid functions for various situation."""
from config.conf import conf
from config.conf import port_mapping
from config.conf import level_strategy
from kits.custom_exception import CustomException
def newdun_dns_insert(params):
group_id = params.get("group_id", type=int)
ap... | 37.013514 | 119 | 0.631617 |
e8c9ab3d9ed498ac6fb406b6a5e867704fd05e9c | 1,028 | py | Python | publication_backbone/models_bases/polymorphic_mptt/managers.py | Excentrics/publication-backbone | 65c9820308b09a6ae1086c265f8d49e36f3724b9 | [
"BSD-3-Clause"
] | 6 | 2016-05-19T14:59:51.000Z | 2020-03-19T10:08:29.000Z | publication_backbone/models_bases/polymorphic_mptt/managers.py | Excentrics/publication-backbone | 65c9820308b09a6ae1086c265f8d49e36f3724b9 | [
"BSD-3-Clause"
] | null | null | null | publication_backbone/models_bases/polymorphic_mptt/managers.py | Excentrics/publication-backbone | 65c9820308b09a6ae1086c265f8d49e36f3724b9 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from mptt.managers import TreeManager
from polymorphic import PolymorphicManager
from polymorphic.query import PolymorphicQuerySet
class PolymorphicMPTTQuerySet(PolymorphicQuerySet):
"""
Base class for querysets
"""
def toplevel(self):
"""
Return all nodes which... | 27.783784 | 79 | 0.646887 |
e8c9c097f043a2207c13a99ad20d00b11e461240 | 1,307 | py | Python | app/core/tests/test_admin.py | mreidt/gf-app | c3d6dc6c88ab2fb508174fbffd3e063710f0c84e | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | mreidt/gf-app | c3d6dc6c88ab2fb508174fbffd3e063710f0c84e | [
"MIT"
] | 33 | 2021-07-05T22:02:09.000Z | 2021-07-11T01:30:12.000Z | app/core/tests/test_admin.py | mreidt/gf-app | c3d6dc6c88ab2fb508174fbffd3e063710f0c84e | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@lgmail.com',
... | 31.119048 | 68 | 0.637337 |
e8c9dd477284f0273b3698331381a0b72005ecde | 1,423 | py | Python | util/data/gen/textinputframework.dll.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | util/data/gen/textinputframework.dll.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | util/data/gen/textinputframework.dll.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | symbols = []
exports = [{'type': 'function', 'name': 'DllCanUnloadNow', 'address': '0x7ffb110e4e00'}, {'type': 'function', 'name': 'DllGetActivationFactory', 'address': '0x7ffb110e4e30'}, {'type': 'function', 'name': 'DllGetClassObject', 'address': '0x7ffb110e4e70'}, {'type': 'function', 'name': 'InputFocusChanged', 'a... | 711.5 | 1,410 | 0.683064 |
e8c9e3b5e729c99a2ab0d2c7cd414c456dcf7565 | 64,519 | py | Python | google/cloud/compute_v1/services/projects/transports/rest.py | LaudateCorpus1/python-compute | a36c637f153c7b4ef49bb6a78c8b09f3746e7af1 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/projects/transports/rest.py | LaudateCorpus1/python-compute | a36c637f153c7b4ef49bb6a78c8b09f3746e7af1 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/projects/transports/rest.py | LaudateCorpus1/python-compute | a36c637f153c7b4ef49bb6a78c8b09f3746e7af1 | [
"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... | 39.704 | 98 | 0.574358 |
e8c9ec5907124ea77354f2afd2a82803805321f0 | 2,592 | py | Python | setup.py | schancel/electrum | ee125e0723a9345757b741aed93be906af80d327 | [
"MIT"
] | 1 | 2020-05-24T08:50:13.000Z | 2020-05-24T08:50:13.000Z | setup.py | Santobak/electrum | ee125e0723a9345757b741aed93be906af80d327 | [
"MIT"
] | null | null | null | setup.py | Santobak/electrum | ee125e0723a9345757b741aed93be906af80d327 | [
"MIT"
] | 1 | 2017-12-22T03:57:04.000Z | 2017-12-22T03:57:04.000Z | #!/usr/bin/env python2
# python setup.py sdist --format=zip,gztar
from setuptools import setup
import os
import sys
import platform
import imp
import argparse
version = imp.load_source('version', 'lib/version.py')
if sys.version_info[:3] < (2, 7, 0):
sys.exit("Error: Electron Cash requires Python version >= 2.7... | 29.793103 | 80 | 0.617284 |
e8c9fc15d2822ce749d804e996f947483216d0b9 | 1,295 | py | Python | squeaknode/bitcoin/block_info.py | CinnamonXI/squeaknode | 412e54f0d3e35057432c74121b7349f9cd226f24 | [
"MIT"
] | null | null | null | squeaknode/bitcoin/block_info.py | CinnamonXI/squeaknode | 412e54f0d3e35057432c74121b7349f9cd226f24 | [
"MIT"
] | null | null | null | squeaknode/bitcoin/block_info.py | CinnamonXI/squeaknode | 412e54f0d3e35057432c74121b7349f9cd226f24 | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Jonathan Zernik
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, mer... | 43.166667 | 80 | 0.771429 |
e8ca0972253bbb0921252610059d72cd7ca6d50c | 119 | py | Python | requester/database/__init__.py | mrf345/flask_restful_api_production_example | 18e9ed6d2a660a9fe188881d4af79af3638cdd73 | [
"MIT"
] | null | null | null | requester/database/__init__.py | mrf345/flask_restful_api_production_example | 18e9ed6d2a660a9fe188881d4af79af3638cdd73 | [
"MIT"
] | null | null | null | requester/database/__init__.py | mrf345/flask_restful_api_production_example | 18e9ed6d2a660a9fe188881d4af79af3638cdd73 | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
db = SQLAlchemy()
migrate = Migrate(db=db)
| 17 | 39 | 0.806723 |
e8ca2029602983315c4ea183dc09ed227b9980e4 | 1,020 | py | Python | qa327_test/conftest.py | KennethWest/ChairNerd | 574d41fef1b784021926527f969ebc2b4c470908 | [
"MIT"
] | null | null | null | qa327_test/conftest.py | KennethWest/ChairNerd | 574d41fef1b784021926527f969ebc2b4c470908 | [
"MIT"
] | null | null | null | qa327_test/conftest.py | KennethWest/ChairNerd | 574d41fef1b784021926527f969ebc2b4c470908 | [
"MIT"
] | null | null | null | import pytest
import subprocess
import os
import signal
import time
import tempfile
from qa327.__main__ import FLASK_PORT
from qa327.__main__ import app
import threading
from werkzeug.serving import make_server
base_url = 'http://localhost:{}'.format(FLASK_PORT)
class ServerThread(threading.Thread):
def __init... | 23.181818 | 60 | 0.661765 |
e8ca25fc40c50d6d33a0582d435f4930fe1f29c4 | 8,897 | py | Python | locallibs/relocatablizer.py | timko98/relocatable-python | 5b65c58322f523c4643435d6726b3a75c984eb1b | [
"Apache-2.0"
] | null | null | null | locallibs/relocatablizer.py | timko98/relocatable-python | 5b65c58322f523c4643435d6726b3a75c984eb1b | [
"Apache-2.0"
] | null | null | null | locallibs/relocatablizer.py | timko98/relocatable-python | 5b65c58322f523c4643435d6726b3a75c984eb1b | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
#
# Copyright 2018 Greg Neagle.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.322097 | 80 | 0.619759 |
e8ca30aecba8e3317ab5f7060c37f24b4f282de0 | 815 | py | Python | leetcode/medium/131-Palindrome_partioning.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | 1 | 2020-02-25T10:32:27.000Z | 2020-02-25T10:32:27.000Z | leetcode/medium/131-Palindrome_partioning.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | null | null | null | leetcode/medium/131-Palindrome_partioning.py | shubhamoli/practice | 5a24fdeb6e5f43b821ef0510fe3b343ddda18f22 | [
"MIT"
] | null | null | null | """
Leetcode #131
"""
from typing import List
class Solution:
def partition(self, s: str) -> List[List[str]]:
if not s:
return s
res = []
def isPalindrome(st):
return st == st[::-1]
def helper(curr, idx):
if idx == len(s)+1:
... | 19.878049 | 75 | 0.408589 |
e8ca712f49dde0e1e615501888cebe062db338cd | 9,069 | py | Python | genienlp/paraphrase/scripts/clean_paraphrasing_dataset.py | Krish-sysadmin/genienlp | 3586e4368eb0b0756a772294daedc043ce55454c | [
"BSD-3-Clause"
] | null | null | null | genienlp/paraphrase/scripts/clean_paraphrasing_dataset.py | Krish-sysadmin/genienlp | 3586e4368eb0b0756a772294daedc043ce55454c | [
"BSD-3-Clause"
] | null | null | null | genienlp/paraphrase/scripts/clean_paraphrasing_dataset.py | Krish-sysadmin/genienlp | 3586e4368eb0b0756a772294daedc043ce55454c | [
"BSD-3-Clause"
] | null | null | null | import csv
import os
import random
import re
import sys
from ...data_utils.progbar import progress_bar
from ...util import detokenize
csv.field_size_limit(sys.maxsize)
def is_english(s):
try:
s.encode(encoding='utf-8').decode('ascii')
except UnicodeDecodeError:
return False
else:
... | 37.7875 | 150 | 0.571507 |
e8cab501d4cfb5ac989b8c39723b60669b7e24ec | 4,398 | py | Python | tql/algo_dl/keras/utils/losses.py | Jie-Yuan/1_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 14 | 2019-06-25T13:46:32.000Z | 2020-10-27T02:04:59.000Z | tql/algo_dl/keras/utils/losses.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | null | null | null | tql/algo_dl/keras/utils/losses.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 7 | 2019-06-25T13:26:16.000Z | 2020-10-27T02:05:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : tql-Python.
# @File : losses
# @Time : 2019-07-03 17:15
# @Author : yuanjie
# @Email : yuanjie@xiaomi.com
# @Software : PyCharm
# @Description :
import tensorflow as tf
from tensorflow.python.keras import backend as K
... | 34.629921 | 117 | 0.609141 |
e8cabc1137ee6b1f5b0a681b83a6b41ec730de55 | 1,987 | py | Python | tests/conftest.py | eifinger/hass-foldingathomecontrol | 9f5d9216fc06eb227eb8a7ab4de07f2fd8d8fc8e | [
"MIT"
] | 15 | 2020-03-28T13:28:40.000Z | 2022-01-03T11:23:45.000Z | tests/conftest.py | eifinger/hass-foldingathomecontrol | 9f5d9216fc06eb227eb8a7ab4de07f2fd8d8fc8e | [
"MIT"
] | 110 | 2020-03-29T17:45:25.000Z | 2022-03-31T17:12:45.000Z | tests/conftest.py | eifinger/hass-foldingathomecontrol | 9f5d9216fc06eb227eb8a7ab4de07f2fd8d8fc8e | [
"MIT"
] | 5 | 2020-04-23T17:49:49.000Z | 2021-12-31T02:03:22.000Z | """Global fixtures for foldingathomecontrol integration."""
# Fixtures allow you to replace functions with a Mock object. You can perform
# many options via the Mock to reflect a particular behavior from the original
# function that you want to see without going through the function's actual logic.
# Fixtures can eithe... | 47.309524 | 131 | 0.798691 |
e8cac4391714609c6fda589eb3cb5ef55c71cc80 | 4,052 | py | Python | src/python/pants/backend/python/subsystems/ipex/ipex_launcher.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | src/python/pants/backend/python/subsystems/ipex/ipex_launcher.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/subsystems/ipex/ipex_launcher.py | tpasternak/pants | edf5716283d449852309fff1a10dd351dfbf3493 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
"""Entrypoint script for a "dehydrated" .ipex file generated with --generate-ipex.
This script will "hydrate" a normal .pex file in the same directory, then execute it.
"""
import json
i... | 36.178571 | 100 | 0.69077 |
e8cad9ee3d354448fc5bbe3e76300fc5a25ca27e | 39,795 | py | Python | src/toil/jobStores/fileJobStore.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 348 | 2018-07-08T03:38:28.000Z | 2022-03-11T18:57:44.000Z | src/toil/jobStores/fileJobStore.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 1,700 | 2018-07-05T18:28:49.000Z | 2022-03-31T14:09:04.000Z | src/toil/jobStores/fileJobStore.py | Hexotical/toil | 312b6e1f221ee7f7f187dd6dbfce1aecffd00e09 | [
"Apache-2.0"
] | 126 | 2018-07-11T18:59:29.000Z | 2022-01-24T03:14:02.000Z | # Copyright (C) 2015-2021 Regents of the University of California
#
# 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 app... | 41.801471 | 143 | 0.630431 |
e8cb15dc2d31f223e4b8a363b56a5c6dd30bafd8 | 1,058 | py | Python | orwell/ext/activity/keys.py | bjknauss/orwell-bot | 707c471d3fb8dec91f9c93ee949903ae4433137c | [
"MIT"
] | null | null | null | orwell/ext/activity/keys.py | bjknauss/orwell-bot | 707c471d3fb8dec91f9c93ee949903ae4433137c | [
"MIT"
] | null | null | null | orwell/ext/activity/keys.py | bjknauss/orwell-bot | 707c471d3fb8dec91f9c93ee949903ae4433137c | [
"MIT"
] | null | null | null | from typing import List, Optional, Union
from discord import Message
from datetime import date, datetime
ActivityDate = Union[date, datetime]
def to_key(keys: List, prefix='activity', sep=':') -> str:
'''Builds the redis key using an array of namespaces'''
ks = [str(k) for k in keys]
ks.insert(0, str(pref... | 33.0625 | 81 | 0.681474 |
e8cb20d79b2e339991f6dd70652297d9bc42c90b | 452 | py | Python | test/test_readfdf.py | hlatkydavid/vnmrjpy | 48707a1000dc87e646e37c8bd686e695bd31a61e | [
"MIT"
] | null | null | null | test/test_readfdf.py | hlatkydavid/vnmrjpy | 48707a1000dc87e646e37c8bd686e695bd31a61e | [
"MIT"
] | null | null | null | test/test_readfdf.py | hlatkydavid/vnmrjpy | 48707a1000dc87e646e37c8bd686e695bd31a61e | [
"MIT"
] | null | null | null | import unittest
import vnmrjpy as vj
import glob
import numpy as np
import matplotlib.pyplot as plt
class Test_FdfReader(unittest.TestCase):
def test_read_img(self):
fdfdir = sorted(glob.glob(vj.fdfs+'/gems*'))[0]
reader = vj.io.FdfReader(fdfdir)
data, header = reader.read()
... | 25.111111 | 55 | 0.670354 |
e8cb3023c875d6dbc275096294e5ce3a0c41a352 | 2,804 | py | Python | test/unit/test_converter.py | 666Chao666/snowflake-connector-python | 81a10e522fcf19d45580c79bc066b7a4eab25485 | [
"Apache-2.0"
] | null | null | null | test/unit/test_converter.py | 666Chao666/snowflake-connector-python | 81a10e522fcf19d45580c79bc066b7a4eab25485 | [
"Apache-2.0"
] | 14 | 2021-01-26T06:53:10.000Z | 2022-03-14T11:16:54.000Z | test/unit/test_converter.py | 666Chao666/snowflake-connector-python | 81a10e522fcf19d45580c79bc066b7a4eab25485 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2021 Snowflake Computing Inc. All right reserved.
#
from logging import getLogger
import pytest
from snowflake.connector import ProgrammingError
from snowflake.connector.connection import DefaultConverterClass
from snowflake.connector.converter imp... | 32.988235 | 112 | 0.671897 |
e8cb5691b2a504367cc0f5141ce4426d7be12c79 | 1,663 | py | Python | utils/python/generate_launch_configuration.py | GAIL-4-BARK/bark-ml | c61c897842c2184ee842428e451bae3be2cd7242 | [
"MIT"
] | null | null | null | utils/python/generate_launch_configuration.py | GAIL-4-BARK/bark-ml | c61c897842c2184ee842428e451bae3be2cd7242 | [
"MIT"
] | 24 | 2020-05-05T13:53:17.000Z | 2020-08-13T15:58:51.000Z | utils/python/generate_launch_configuration.py | Brucknem/bark-ml | c61c897842c2184ee842428e451bae3be2cd7242 | [
"MIT"
] | null | null | null | from absl import app
from absl import flags
FLAGS = flags.FLAGS
flags.DEFINE_string(
'script_path',
help='The name of the py file to generate a launch config for.',
default="")
def generate(script_path=None):
"""
Generates a copy & paste configuration for the VS Code launch.json
"""
if not script... | 30.796296 | 131 | 0.638605 |
e8cb69374f152a4200b136aff28f856795cab925 | 6,779 | py | Python | chrome/common/extensions/docs/server2/reference_resolver.py | leiferikb/bitpop-private | 4c967307d228e86f07f2576068a169e846c833ca | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-11-15T15:17:43.000Z | 2021-11-15T15:17:43.000Z | chrome/common/extensions/docs/server2/reference_resolver.py | houseoflifeproperty/bitpop-private | 4c967307d228e86f07f2576068a169e846c833ca | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome/common/extensions/docs/server2/reference_resolver.py | houseoflifeproperty/bitpop-private | 4c967307d228e86f07f2576068a169e846c833ca | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T07:24:02.000Z | 2020-11-04T07:24:02.000Z | # 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.
from file_system import FileNotFoundError
import object_store
import logging
import string
def _ClassifySchemaNode(node_name, api):
"""Attempt to clas... | 35.867725 | 80 | 0.59404 |
e8cb76ea8fb94b6be0285235047791200a332f62 | 1,735 | py | Python | debate/migrations/0001_initial.py | steventimberman/debateIt | 32b17552894b2c54a5f57c36257f4b6bc8846711 | [
"MIT"
] | null | null | null | debate/migrations/0001_initial.py | steventimberman/debateIt | 32b17552894b2c54a5f57c36257f4b6bc8846711 | [
"MIT"
] | 4 | 2017-08-16T03:50:16.000Z | 2017-08-22T05:41:04.000Z | debate/migrations/0001_initial.py | steventimberman/masterDebater | 32b17552894b2c54a5f57c36257f4b6bc8846711 | [
"MIT"
] | 1 | 2020-11-04T08:39:22.000Z | 2020-11-04T08:39:22.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-07-20 02:16
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | 35.408163 | 120 | 0.576945 |
e8cb8432121410bdaf60183c31dcaa1102934a17 | 325 | py | Python | sumoProject/__init__.py | szkLaszlo/RLHighWay | 2ea752265bc89618e736089475cb4706ead8fe92 | [
"MIT"
] | 1 | 2021-08-29T09:12:29.000Z | 2021-08-29T09:12:29.000Z | sumoProject/__init__.py | szkLaszlo/RLHighWay | 2ea752265bc89618e736089475cb4706ead8fe92 | [
"MIT"
] | null | null | null | sumoProject/__init__.py | szkLaszlo/RLHighWay | 2ea752265bc89618e736089475cb4706ead8fe92 | [
"MIT"
] | null | null | null | import os
import sys
from gym.envs.registration import register
register(
id='EPHighWay-v1',
entry_point='sumoProject.envs:EPHighWayEnv',
)
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
os.system('export SUMO_HOME="/usr/share/sum... | 20.3125 | 58 | 0.707692 |
e8cb9375b3611942ea42179ca3d8adfde9d03dc2 | 1,657 | py | Python | edb/tools/docs/shared.py | aeros/edgedb | db8c240d1607765799caf124a4b418250e0c0a96 | [
"Apache-2.0"
] | null | null | null | edb/tools/docs/shared.py | aeros/edgedb | db8c240d1607765799caf124a4b418250e0c0a96 | [
"Apache-2.0"
] | null | null | null | edb/tools/docs/shared.py | aeros/edgedb | db8c240d1607765799caf124a4b418250e0c0a96 | [
"Apache-2.0"
] | null | null | null | #
# This source file is part of the EdgeDB open source project.
#
# Copyright 2018-present MagicStack Inc. and the EdgeDB 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... | 29.589286 | 74 | 0.705492 |
e8cbaae2839d528377cbd8741deb972bf2eafebf | 2,356 | py | Python | parts-site/configurations/debug/msvc_win32-any_win32-x86.py | eozturk1/epid-sdk | 1efb25ed40f8d6082112efa02e8f25c7128cd7ba | [
"Apache-2.0"
] | 30 | 2017-07-26T20:03:19.000Z | 2021-10-14T23:38:54.000Z | parts-site/configurations/debug/msvc_win32-any_win32-x86.py | eozturk1/epid-sdk | 1efb25ed40f8d6082112efa02e8f25c7128cd7ba | [
"Apache-2.0"
] | 9 | 2018-09-25T18:32:42.000Z | 2022-02-18T12:23:40.000Z | parts-site/configurations/debug/msvc_win32-any_win32-x86.py | eozturk1/epid-sdk | 1efb25ed40f8d6082112efa02e8f25c7128cd7ba | [
"Apache-2.0"
] | 14 | 2017-08-31T19:53:23.000Z | 2021-02-27T01:08:14.000Z | ############################################################################
# Copyright 2016-2019 Intel Corporation
#
# 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.... | 42.071429 | 76 | 0.402377 |
e8cbad537d8c11be925825fd69f8e3d4075866a5 | 309 | py | Python | Seeder/qa/urls.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 8 | 2017-08-16T19:18:57.000Z | 2022-01-24T10:08:19.000Z | Seeder/qa/urls.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 242 | 2017-02-03T19:15:52.000Z | 2022-03-25T08:02:52.000Z | Seeder/qa/urls.py | WebarchivCZ/Seeder | 1958c5d3f6bdcbbdb2c81dcb6abc7f689125b6a8 | [
"MIT"
] | 2 | 2019-03-06T12:36:29.000Z | 2019-07-08T12:52:20.000Z | from django.urls import path
from .views import *
urlpatterns = [
path('source/<int:pk>/create', QACreate.as_view(), name='create'),
path('<int:pk>/edit', QAEdit.as_view(), name='edit'),
path('<int:pk>/detail', QADetail.as_view(), name='detail'),
path('', ListView.as_view(), name='list'),
]
| 30.9 | 70 | 0.63754 |
e8cbde4abe233d1d969ab2c99b3101e6dbd657e4 | 6,115 | py | Python | src/mds/api/handlers.py | ewinkler/sana.mds | 439a83a7180ed5c9384732935983392122bc2411 | [
"BSD-3-Clause"
] | null | null | null | src/mds/api/handlers.py | ewinkler/sana.mds | 439a83a7180ed5c9384732935983392122bc2411 | [
"BSD-3-Clause"
] | null | null | null | src/mds/api/handlers.py | ewinkler/sana.mds | 439a83a7180ed5c9384732935983392122bc2411 | [
"BSD-3-Clause"
] | null | null | null | '''
Created on Feb 29, 2012
:Authors: Sana Dev Team
:Version: 2.0
'''
import logging
from django.conf import settings
from django.core.paginator import Paginator, InvalidPage, EmptyPage
from piston.handler import BaseHandler
from piston.utils import rc
from .decorators import validate
from .responses import succeed... | 33.78453 | 88 | 0.569092 |
e8cbf0002d59d4f58b775d74b4ac2c0240df710e | 71 | py | Python | researchtool/__init__.py | ChristophBeckmann/ResearchTool | 178ae87a23ea7fcc908505a8469075be3c2205ee | [
"MIT"
] | null | null | null | researchtool/__init__.py | ChristophBeckmann/ResearchTool | 178ae87a23ea7fcc908505a8469075be3c2205ee | [
"MIT"
] | null | null | null | researchtool/__init__.py | ChristophBeckmann/ResearchTool | 178ae87a23ea7fcc908505a8469075be3c2205ee | [
"MIT"
] | null | null | null | # required to make Python treat the directories as containing packages; | 71 | 71 | 0.830986 |
e8cc1e4e8987a8500b9ae42f0f590b1e229c9f90 | 2,818 | py | Python | aoba_discord_bot/cogs/bot_admin/bot_admin_cog.py | douglascdev/aoba_discord_bot | 4f6c67bca7716a7950651dbc25ad6316e1dad908 | [
"MIT"
] | null | null | null | aoba_discord_bot/cogs/bot_admin/bot_admin_cog.py | douglascdev/aoba_discord_bot | 4f6c67bca7716a7950651dbc25ad6316e1dad908 | [
"MIT"
] | 21 | 2021-08-12T20:57:46.000Z | 2021-08-16T22:13:58.000Z | aoba_discord_bot/cogs/bot_admin/bot_admin_cog.py | douglascdev/aoba_discord_bot | 4f6c67bca7716a7950651dbc25ad6316e1dad908 | [
"MIT"
] | null | null | null | from typing import List
import discord
from discord import Guild, Member, TextChannel
from discord.ext import commands
from discord.ext.commands import Context
from aoba_discord_bot import AobaDiscordBot
class BotAdmin(
commands.Cog,
name="BotAdmin",
):
def __init__(self, bot: AobaDiscordBot):
s... | 32.390805 | 81 | 0.626686 |
e8cc1f1378f86d9ca3d99c0d3fe4ca490f264272 | 2,293 | py | Python | content/_build/jupyter_execute/01_refresher/exercise/questions.py | aviadr1/learn-python3 | e90f05aa026772c6db7fd4f3ccc2518d983ac4fa | [
"MIT"
] | null | null | null | content/_build/jupyter_execute/01_refresher/exercise/questions.py | aviadr1/learn-python3 | e90f05aa026772c6db7fd4f3ccc2518d983ac4fa | [
"MIT"
] | null | null | null | content/_build/jupyter_execute/01_refresher/exercise/questions.py | aviadr1/learn-python3 | e90f05aa026772c6db7fd4f3ccc2518d983ac4fa | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
#
# <a href="https://colab.research.google.com/github/aviadr1/learn-advanced-python/blob/master/content/01_refresher/exercise/questions.ipynb" target="_blank">
# <img src="https://colab.research.google.com/assets/colab-badge.svg"
# title="Open this file in Google Colab" alt... | 19.767241 | 157 | 0.63454 |
e8cc27fe698b5855ffd855bd47a9e577e061e3dc | 3,706 | py | Python | configs/nturgbd/i3d_kinetics400_3d_rgb_inception.py | edz-o/VideoActionCues | 032ae688f5984c0faf8a184fbd982cd3dfeb7a81 | [
"Apache-2.0"
] | null | null | null | configs/nturgbd/i3d_kinetics400_3d_rgb_inception.py | edz-o/VideoActionCues | 032ae688f5984c0faf8a184fbd982cd3dfeb7a81 | [
"Apache-2.0"
] | null | null | null | configs/nturgbd/i3d_kinetics400_3d_rgb_inception.py | edz-o/VideoActionCues | 032ae688f5984c0faf8a184fbd982cd3dfeb7a81 | [
"Apache-2.0"
] | 1 | 2020-07-22T18:11:54.000Z | 2020-07-22T18:11:54.000Z | # model settings
model = dict(
type='TSN3D',
backbone=dict(
type='I3D',
pretrained=None,
bn_eval=False,
partial_bn=False,
),
spatial_temporal_module=dict(
type='SimpleSpatialTemporalModule',
spatial_type='avg',
temporal_size=8,
spatial_... | 27.451852 | 81 | 0.627901 |
e8cc554984f840ec03edf65f46b379ea99ae63e2 | 44,693 | py | Python | drizzlepac/hlautils/astrometric_utils.py | jhunkeler/drizzlepac | 09ca153b8e4f4e03dd155c61243d722e1c40caee | [
"BSD-3-Clause"
] | null | null | null | drizzlepac/hlautils/astrometric_utils.py | jhunkeler/drizzlepac | 09ca153b8e4f4e03dd155c61243d722e1c40caee | [
"BSD-3-Clause"
] | null | null | null | drizzlepac/hlautils/astrometric_utils.py | jhunkeler/drizzlepac | 09ca153b8e4f4e03dd155c61243d722e1c40caee | [
"BSD-3-Clause"
] | null | null | null | """Utilities to support creation of astrometrically accurate reference catalogs
The function, create_astrometric_catalog, allows the user to query an
astrometric catalog online to generate a catalog of astrometric sources that
should fall within the field-of-view of all the input images.
This module relies on the def... | 38.199145 | 118 | 0.653771 |
e8cc771e624fea2d1691ff10210ffb377d144e5f | 8,206 | py | Python | appengine/swarming/swarming_bot/__main__.py | stefb965/luci-py | e0a8a5640c4104e5c90781d833168aa8a8d1f24d | [
"Apache-2.0"
] | null | null | null | appengine/swarming/swarming_bot/__main__.py | stefb965/luci-py | e0a8a5640c4104e5c90781d833168aa8a8d1f24d | [
"Apache-2.0"
] | null | null | null | appengine/swarming/swarming_bot/__main__.py | stefb965/luci-py | e0a8a5640c4104e5c90781d833168aa8a8d1f24d | [
"Apache-2.0"
] | 1 | 2020-07-05T19:54:40.000Z | 2020-07-05T19:54:40.000Z | # Copyright 2014 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Runs either task_runner.py, bot_main.py or bot_config.py.
The imports are done late so if an ImportError occurs, it is localized to this
comma... | 30.966038 | 80 | 0.714843 |
e8cc8d13ca4823e7141328f85f5843ec931d95c2 | 3,979 | py | Python | alipay/aop/api/request/AlipayTradeMerchantCreditQueryRequest.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/request/AlipayTradeMerchantCreditQueryRequest.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/request/AlipayTradeMerchantCreditQueryRequest.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.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayTradeMerchantCreditQueryModel import AlipayTradeMerchantCreditQueryModel
class AlipayTradeMerchantCreditQueryRequest(object):
... | 27.441379 | 148 | 0.645388 |
e8cc974f384c3a9f89c417ef02b43ae2f68f4175 | 1,703 | py | Python | pandaharvester/harvestercore/event_spec.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 7 | 2019-08-30T07:35:48.000Z | 2022-02-13T14:46:53.000Z | pandaharvester/harvestercore/event_spec.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 29 | 2019-09-20T14:04:37.000Z | 2021-09-13T12:53:05.000Z | pandaharvester/harvestercore/event_spec.py | tsulaiav/harvester | ca3f78348019dd616738f2da7d50e81700a8e6b9 | [
"Apache-2.0"
] | 15 | 2019-07-30T11:48:29.000Z | 2022-03-29T21:49:05.000Z | """
Event spec class
"""
from past.builtins import long
from future.utils import iteritems
from .spec_base import SpecBase
class EventSpec(SpecBase):
# attributes
attributesWithTypes = ('eventRangeID:text / index',
'PandaID:integer / index',
'eventStatu... | 29.877193 | 71 | 0.510863 |
e8ccfd5a3486fe26ff57280c071e6f2f909f9ac9 | 390 | py | Python | CodeChef/Practice/SUBINC.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 2 | 2020-06-25T21:10:32.000Z | 2020-12-10T06:53:45.000Z | CodeChef/Practice/SUBINC.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | null | null | null | CodeChef/Practice/SUBINC.py | mishrakeshav/Competitive-Programming | b25dcfeec0fb9a9c71bf3a05644b619f4ca83dd2 | [
"MIT"
] | 3 | 2020-05-15T14:17:09.000Z | 2021-07-25T13:18:20.000Z | from math import ceil,floor, factorial as fact, inf
from copy import deepcopy
def get_list():
return list(map(int,input().split()))
def get_int():
return int(input())
for t in range(get_int()):
n = get_int()
a = get_list()
dp = [1 for i in range(n)]
for i in range(1,n):
if a[i] >= a[i-... | 22.941176 | 52 | 0.55641 |
e8cd05120db3bd07cc49bbcc144211966dd80715 | 32,024 | py | Python | Infra_2022_update/one_pagers/Make_pdfs.py | ScilifelabDataCentre/Annual-report-2021 | 6a5d9ca0320ee6cba39245e81e2bd61f1a6822e1 | [
"MIT"
] | null | null | null | Infra_2022_update/one_pagers/Make_pdfs.py | ScilifelabDataCentre/Annual-report-2021 | 6a5d9ca0320ee6cba39245e81e2bd61f1a6822e1 | [
"MIT"
] | null | null | null | Infra_2022_update/one_pagers/Make_pdfs.py | ScilifelabDataCentre/Annual-report-2021 | 6a5d9ca0320ee6cba39245e81e2bd61f1a6822e1 | [
"MIT"
] | null | null | null | # Regular packages
import os
import pandas as pd
# Specific imports from reportlab
from reportlab.platypus import (
BaseDocTemplate,
Paragraph,
Spacer,
Image,
PageTemplate,
Frame,
CondPageBreak,
)
from reportlab.platypus.flowables import HRFlowable
from reportlab.lib.pagesizes import A4
fr... | 33.497908 | 398 | 0.53029 |
e8cd1342e7916a6235f85b15dd29de536ed1c3fa | 2,940 | py | Python | dtor/utilities/torchutils.py | Tevien/dtor | bb2954074d4a299c129d44afd722084980b792b5 | [
"MIT"
] | null | null | null | dtor/utilities/torchutils.py | Tevien/dtor | bb2954074d4a299c129d44afd722084980b792b5 | [
"MIT"
] | 1 | 2021-03-12T10:57:24.000Z | 2021-03-12T10:57:24.000Z | dtor/utilities/torchutils.py | Tevien/dtor | bb2954074d4a299c129d44afd722084980b792b5 | [
"MIT"
] | null | null | null | from dtor.logconf import logging
import numpy as np
from sklearn.metrics import f1_score
log = logging.getLogger(__name__)
# Used for computeBatchLoss and logMetrics to index into metrics_t/metrics_a
METRICS_LABEL_NDX = 0
METRICS_PRED_NDX = 1
METRICS_LOSS_NDX = 2
METRICS_SIZE = 3
def process_metrics(metrics_t, class... | 36.75 | 86 | 0.637415 |
e8cd34798ba343c7aa888db4e2b435a4a74f0057 | 3,085 | py | Python | ucscsdk/mometa/extpol/ExtpolDomain.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/extpol/ExtpolDomain.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/extpol/ExtpolDomain.py | CiscoUcs/ucscsdk | b582df77e3cf8bc4c48347e3d67f8cffa62f78c4 | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for ExtpolDomain ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class ExtpolDomainConsts():
PRODUCT_FAMILY_UCS_CLASSIC = "ucs-classic"
PRODUCT_FAMILY_UCS_... | 55.089286 | 457 | 0.672934 |
e8cd49d66637b3a566f4d067a13c80847e721df0 | 33,777 | py | Python | pyiron_atomistics/vasp/vasprun.py | pyiron/pyiron_atomistic | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 14 | 2021-01-18T10:03:56.000Z | 2022-03-01T20:59:35.000Z | pyiron_atomistics/vasp/vasprun.py | pyiron/pyiron_atomistics | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 569 | 2018-04-12T06:37:14.000Z | 2022-03-31T18:06:27.000Z | pyiron_atomistics/vasp/vasprun.py | pyiron/pyiron_atomistic | 0cd4c910806f44dfc829ddd642e323efcf7e36d5 | [
"BSD-3-Clause"
] | 6 | 2018-10-23T09:48:48.000Z | 2022-02-13T12:13:00.000Z | # coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
import os
# import xml.etree.cElementTree as ETree
import numpy as np
from collections import OrderedDict
from pyiron_a... | 41.855019 | 119 | 0.506972 |
e8cd4a3971f0b43abe59e359266490ba3dcd778f | 1,728 | py | Python | build/lib/TEF/__main__.py | tll549/TEF | 8dc50b0d0966b782b04fcd9fc846c0756820782f | [
"MIT"
] | 2 | 2019-08-07T15:44:28.000Z | 2019-08-08T07:34:24.000Z | build/lib/TEF/__main__.py | tll549/TEF | 8dc50b0d0966b782b04fcd9fc846c0756820782f | [
"MIT"
] | null | null | null | build/lib/TEF/__main__.py | tll549/TEF | 8dc50b0d0966b782b04fcd9fc846c0756820782f | [
"MIT"
] | 1 | 2019-08-06T15:40:16.000Z | 2019-08-06T15:40:16.000Z | # """Read the latest Real Python tutorials
# Usage:
# ------
# $ realpython [options] [id] [id ...]
# List the latest tutorials:
# $ realpython
# Read one tutorial:
# $ realpython <id>
# where <id> is the number shown when listing tutorials.
# Read the latest tutorial:
# $ realpython 0
# ... | 20.329412 | 79 | 0.588542 |
e8cd56d11d0980873d4ecdd2adf5150bab4c4351 | 2,279 | py | Python | plan2explore/utils/dist_utils.py | sarthak268/plan2explore | 264f513d46c6e971d5523782344a694b17139a20 | [
"Apache-2.0"
] | 8 | 2021-10-14T03:14:23.000Z | 2022-03-15T21:31:17.000Z | plan2explore/utils/dist_utils.py | sarthak268/plan2explore | 264f513d46c6e971d5523782344a694b17139a20 | [
"Apache-2.0"
] | null | null | null | plan2explore/utils/dist_utils.py | sarthak268/plan2explore | 264f513d46c6e971d5523782344a694b17139a20 | [
"Apache-2.0"
] | 1 | 2021-09-13T20:42:28.000Z | 2021-09-13T20:42:28.000Z | import torch
import torch.nn.functional as F
def safe_entropy(dist, dim=None, eps=1e-12):
"""Computes entropy even if some entries are 0."""
return -torch.sum(dist * safe_log_prob(dist, eps), dim=dim)
def safe_log_prob(tensor, eps=1e-12):
"""Safe log of probability values (must be between 0 and 1)"""
... | 32.098592 | 107 | 0.683633 |
e8cd6eaebc10badc081ba7f0007181f0b7bc9573 | 2,321 | py | Python | packages/service-library/src/servicelib/aiopg_utils.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | packages/service-library/src/servicelib/aiopg_utils.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | 2 | 2018-05-13T09:10:57.000Z | 2019-03-06T08:10:40.000Z | packages/service-library/src/servicelib/aiopg_utils.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | """
TODO: test!
SEE https://aiopg.readthedocs.io/en/stable/
SEE asyncpg https://magicstack.github.io/asyncpg/current/index.html
"""
import aiopg.sa
import attr
import psycopg2
import sqlalchemy as sa
import logging
import warnings
logger = logging.getLogger(__name__)
warnings.warn("DO NOT USE IN PRODUCTION, STILL U... | 25.505495 | 131 | 0.676433 |
e8cd92710f070b46ca325dabee80a87d074e6da1 | 1,068 | py | Python | app/main/routes.py | grosniko/chat | 1ca489074226c01eadb72bc4d9be3d5769ebfed2 | [
"MIT"
] | null | null | null | app/main/routes.py | grosniko/chat | 1ca489074226c01eadb72bc4d9be3d5769ebfed2 | [
"MIT"
] | null | null | null | app/main/routes.py | grosniko/chat | 1ca489074226c01eadb72bc4d9be3d5769ebfed2 | [
"MIT"
] | null | null | null | from flask import session, redirect, url_for, render_template, request
from . import main
from .forms import LoginForm
@main.route('/', methods=['GET', 'POST'])
def index():
"""Login form to enter a room."""
form = LoginForm()
if form.validate_on_submit():
session['name'] = form.name.data
... | 32.363636 | 70 | 0.601124 |
e8cd97a18a6c483873a0155b6cf04f69463b54f0 | 813 | py | Python | lewis_emulators/keithley_2400/control_modes.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 2 | 2020-10-20T16:49:13.000Z | 2021-02-19T10:41:44.000Z | lewis_emulators/keithley_2400/control_modes.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 9 | 2019-03-22T15:35:15.000Z | 2021-07-28T11:05:43.000Z | lewis_emulators/keithley_2400/control_modes.py | ISISComputingGroup/EPICS-DeviceEmulator | 026c2a14a16bb204ea7527e3765daa182cafa814 | [
"BSD-3-Clause"
] | 1 | 2020-10-21T17:02:44.000Z | 2020-10-21T17:02:44.000Z | """
Effectively enumerators for each of the various modes supported by the device. Allows checking for invalid mode
strings and helps avoid typos.
"""
class Mode(object):
MODES = []
class ResistanceRangeMode(Mode):
AUTO = "1"
MANUAL = "0"
MODES = [AUTO, MANUAL]
class AutorangeMode(Mode):
AUTO ... | 14.781818 | 111 | 0.640836 |
e8cdb28c840f45079092980d730a814b2b106d04 | 158 | py | Python | scripts/parse_uuid.py | PimmyTrousers/idawilli | b66020f9404a1b1dfb6ec5dc146086b659a81160 | [
"Apache-2.0"
] | null | null | null | scripts/parse_uuid.py | PimmyTrousers/idawilli | b66020f9404a1b1dfb6ec5dc146086b659a81160 | [
"Apache-2.0"
] | null | null | null | scripts/parse_uuid.py | PimmyTrousers/idawilli | b66020f9404a1b1dfb6ec5dc146086b659a81160 | [
"Apache-2.0"
] | null | null | null | import uuid
import ida_bytes
import ida_kernwin
buf = ida_bytes.get_many_bytes(ida_kernwin.get_screen_ea(), 0x10)
uid = uuid.UUID(bytes_le=buf)
print(uid)
| 15.8 | 65 | 0.797468 |
e8cdd8fd8d11133d9a4ff370653b06643859a20c | 1,803 | py | Python | tests/sample_data.py | robswc/quickbase-json-api-client | 2c9460ea2a5715d61fb0dc59bf9ae40a98751681 | [
"MIT"
] | null | null | null | tests/sample_data.py | robswc/quickbase-json-api-client | 2c9460ea2a5715d61fb0dc59bf9ae40a98751681 | [
"MIT"
] | 1 | 2021-10-17T18:37:02.000Z | 2021-10-17T18:37:02.000Z | tests/sample_data.py | robswc/quickbase-json-api-client | 2c9460ea2a5715d61fb0dc59bf9ae40a98751681 | [
"MIT"
] | null | null | null | record_data = {
"data": [
{
"6": {
"value": "Andre Harris"
},
"7": {
"value": 10
},
"8": {
"value": "2019-12-18T08:00:00.000Z"
}
}
],
"fields": [
{
"id"... | 28.171875 | 97 | 0.345535 |
e8cddfd21915c98440a3e9d0739494b307da5597 | 11,161 | py | Python | oscar/lib/python2.7/site-packages/pbr/tests/test_integration.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pbr/tests/test_integration.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/pbr/tests/test_integration.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # 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 un... | 41.337037 | 80 | 0.542783 |
e8cdf30d1711f97f2fbebed15bdeef5eeb26dff2 | 2,271 | py | Python | spa/management/commands/get_avatars.py | fergalmoran/dss.api | d1b9fb674b6dbaee9b46b9a3daa2027ab8d28073 | [
"BSD-2-Clause"
] | null | null | null | spa/management/commands/get_avatars.py | fergalmoran/dss.api | d1b9fb674b6dbaee9b46b9a3daa2027ab8d28073 | [
"BSD-2-Clause"
] | null | null | null | spa/management/commands/get_avatars.py | fergalmoran/dss.api | d1b9fb674b6dbaee9b46b9a3daa2027ab8d28073 | [
"BSD-2-Clause"
] | null | null | null | from azure.storage.blob import BlobService
import urllib.request, urllib.error, urllib.parse
from allauth.socialaccount.models import SocialAccount
from django.core.files.base import File
from django.core.files.temp import NamedTemporaryFile
from django.core.management.base import NoArgsCommand
from requests import re... | 33.895522 | 84 | 0.589168 |
e8cdfbcfd0e8ecebdf09e7c022e09aa3df1e888b | 982 | py | Python | fpl/team.py | taoprajjwal/fpl | aa3d762429f59543aac36b53723746049dc8b210 | [
"MIT"
] | null | null | null | fpl/team.py | taoprajjwal/fpl | aa3d762429f59543aac36b53723746049dc8b210 | [
"MIT"
] | null | null | null | fpl/team.py | taoprajjwal/fpl | aa3d762429f59543aac36b53723746049dc8b210 | [
"MIT"
] | null | null | null | import requests
API_BASE_URL = "https://fantasy.premierleague.com/drf/"
class Team(object):
"""
A class representing a real team in the Fantasy Premier League.
"""
def __init__(self, team_id):
self._id = team_id
self._information = self._get_information()
#: The name of the t... | 33.862069 | 76 | 0.656823 |
e8ce022bae13c00492e21c1e99c13bd1d5f62775 | 340 | py | Python | office365/sharepoint/logger/logFileInfoCollection.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | office365/sharepoint/logger/logFileInfoCollection.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | office365/sharepoint/logger/logFileInfoCollection.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | from office365.runtime.client_object_collection import ClientObjectCollection
from office365.sharepoint.logger.logFileInfo import LogFileInfo
class LogFileInfoCollection(ClientObjectCollection):
def __init__(self, context, resource_path=None):
super(LogFileInfoCollection, self).__init__(context, LogFileI... | 37.777778 | 88 | 0.838235 |
e8ce3b0be42df9a420a1ce4dbd64b114974e8e15 | 4,533 | py | Python | setup.py | bhumikapahariapuresoftware/django-anymail | 0252010fb3d4652c3c234fc6dba36d11c7602543 | [
"BSD-3-Clause"
] | null | null | null | setup.py | bhumikapahariapuresoftware/django-anymail | 0252010fb3d4652c3c234fc6dba36d11c7602543 | [
"BSD-3-Clause"
] | null | null | null | setup.py | bhumikapahariapuresoftware/django-anymail | 0252010fb3d4652c3c234fc6dba36d11c7602543 | [
"BSD-3-Clause"
] | null | null | null | import re
from codecs import open # to use a consistent encoding
from collections import OrderedDict
from os import path
from setuptools import setup
here = path.abspath(path.dirname(__file__))
# get versions from anymail/_version.py,
# but without importing from anymail (which would break setup)
with open(path.join... | 39.077586 | 110 | 0.62056 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.