text stringlengths 3.07k 12.6k |
|---|
#-
# ==========================================================================
#-
# ==========================================================================
# Copyright (C) 2012 Autodesk, Inc. and/or its licensors. All
# rights reserved.
#
# The coded instructions, statements, computer programs, and/or related
# ... |
#!/usr/bin/python -O
from requests import Session
import urllib3
import sys
import getpass
import argparse
def get_target(user, right):
if right['account_mapping']:
target = "{}@{}:{}:{}".format(user, right['device'], right['service'], user)
elif right['interactive_login']:
target = "{}@{}:{}:... |
import numpy as np
import glob
import os
import re
import matplotlib.pyplot as plt
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
color_dictionary = {
0: "#1F618D", 1: "#F322CD", 2: "#D35400", 3: "#7FB3D5", 4: "#F1948A",
5: "#5B2C6F", 6: "#800000", 7: "#008000", 8: "#0080... |
"""
Infinite evaluation loop going through the checkpoints in the model directory
as they appear and evaluating them. Accuracy and average loss are printed and
added as tensorboard summaries.
"""
import argparse
from datetime import datetime
import json
import math
import os
import sys
import time
import numpy as np
i... |
#!/usr/bin/env python
"""
Example Cluster Rule - allnodes_cpu
===================================
This example demonstrates a custome spec, parser, facts, combiner
and multiple cluster rules. It can be run using the command::
$ insights-run -p examples.cluster_rules.allnodes_cpu \
-i topology_allnode... |
#!/usr/bin/env python3
# (c) L.Spiegelberg 2017-2021
# Tuplex based cleaning script
import tuplex
import time
import sys
import json
import os
import glob
import argparse
import re
import math
def extractBd(x):
val = x['facts and features']
max_idx = val.find(' bd')
if max_idx < 0:
max_idx = len(va... |
#!/usr/bin/env python
#
# This code was copied from the data generation program of Tencent Alchemy
# project (https://github.com/tencent-alchemy).
#
#
# #
# # Copyright 2019 Tencent America LLC. All Rights Reserved.
# #
# # Licensed under the Apache License, Version 2.0 (the "License");
# # you may not use this file ex... |
"""
system users
"""
import zoom
from zoom.audit import audit
from zoom.components import success
from zoom.collect import Collection, CollectionView, CollectionController, RawSearch
from zoom.context import context
from zoom.forms import Form
from zoom.users import User, Users
from zoom.tools import home, now
imp... |
from datetime import datetime
import numpy as np
from h5py import Group, File
from ._version import get_versions
from .reference_resolving import InputClassBase
from .settings import get_settings
import parse
def get_converter_version(h5file, group_str):
if group_str in h5file and 'converterVersion' in h5file.ge... |
# Standard Library Imports
import os
import subprocess
import logging
import tempfile
from logging.handlers import RotatingFileHandler
from multiprocessing import Process, freeze_support
import msvcrt
import ctypes
# Third Party Imports
import uvicorn
from fastapi import FastAPI
import MetaTrader5 as mt5
# General C... |
import datetime
import time
import glob
import os
import random
import string
import uuid
import filetype
import timeout_decorator
from flask import Flask, jsonify, request, send_from_directory, Response
from flask_cors import CORS
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
fro... |
from django.shortcuts import render, redirect, HttpResponse
from .models import get_model_by_name, get_unique
from django.contrib.auth.decorators import login_required, user_passes_test
#from accounts.permissions import is_editor
from sopot.http_tools import get_posted_text, render_error
from django.http import JsonRes... |
from moviepy.editor import VideoFileClip, concatenate_videoclips
from slugify import slugify
from tqdm import tqdm
import tempfile
import random
import proglog
import requests
import os
import shutil
from . import acr_cloud
def sort_clips_chronologically(clips):
clips.sort(key=lambda k: k["created_at"])
def sor... |
import numpy as np
import random as rn
import math
import time
import sys
import copy
from itertools import combinations
import os
from tqdm import tqdm
def FunAnneal(n, m, alignment_r, alignment_c):
m=m[alignment_r,:]
m=m[:,alignment_c]
E=np.sum(((n-m)**2)/(n+m))
#E=1-np.corrcoef(n.ravel(),m.ravel())[... |
#!/bin/python3
import requests as req
import json, os, argparse
from requests.packages.urllib3 import disable_warnings
disable_warnings()
"""
reverse IP, Subdomain Enumerate, Etc.
code by Dinar, fb.com/dinar1337
free of use
"""
class YaGabut(object):
def __init__(self, domain='http://google.com/', e... |
import sys
sys.path.append("./src/")
import pandas as pd
import os
import torch
from utils import load_model, load_test_df, save_test_df, get_torch_device, save_metrics
from models.seq2seq import Seq2seq
from models.transformer import transformer
from inference.inference_helpers import GreedyDecoder, BeamDecoder
impor... |
import torch
import numpy as np
from models.losses import FocalLoss
from models.decode import ctdet_decode
from models.utils import _sigmoid, _tranpose_and_gather_feat
from utils.debugger import Debugger
from utils.post_process import ctdet_post_process
from .base_trainer import BaseTrainer
from importlib.machinery i... |
# Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import os
from stringcase import snakecase
from ..utils import read_file_lines
def compute_subtokens(token):
return [x f... |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import logging
from typing import Any, Callable, List, Tuple
import gym
import numpy as np
from reagent.gym.types import Transition
from reagent.replay_memory.circular_replay_buffer import ReplayBuffer
logger = logging.ge... |
from typing import List
def _get_cortex_dict() -> dict:
'''Returns dictionary of {eight cortical lobe: labels}'''
ofc = ['parsorbitalis', 'medialorbitofrontal', 'lateralorbitofrontal']
mpfc = ['caudalanteriorcingulate', 'rostralanteriorcingulate',
'superiorfrontal']
lpfc = ['parstriangular... |
#!/bin/env python
"""
The MIT License
Copyright (c) 2010 The Chicago Tribune & Contributors
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 ... |
import unittest
from unittest.mock import patch
from tmc import points
from tmc.utils import load, load_module, reload_module, get_stdout, check_source
from functools import reduce
import os
import textwrap
from random import randint
exercise = 'src.sudoku_row'
function = 'row_correct'
def get_correct(test_case: lis... |
##########################
# author: banbao #
# language: python #
# encoding: utf-8 #
##########################
# 简易银行
from pathlib import Path # 文件
import random # 随机数
import re # 正则表达式匹配
# 账户(Account)类
class Account(object):
# 受保护的属性或者方法, 使用一个下划线开头(外界能够... |
# Original brittle read merge tool for FS6_proc.py lost almost all of my reads -
# from 7.7M down to ~60K!
# Visual inspection of files suggests more reads can be recovered.
# Approach: start with file of reads with 5' and 3' constants stripped and bin ID'd,
# sorted alphabetically by sequence.
# Filter by sequence le... |
import tweepy
from tweepy import API
from tweepy import OAuthHandler
from configparser import ConfigParser
from couchDB.db_util import cdb
import datetime
import time
import json
import os
import sys
def _couchdb_get_url(section='DEFAULT', verbose=False):
global config
config = ConfigParser()
url_file = '... |
import glob
import pickle
import time
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
from sklearn.svm import LinearSVC
import features
def load_data():
# cars = glob.glob('data/small/veh... |
from __future__ import division
import cv2
import dlib
import time
import sys
import numpy as np
import face_recognition
# Model files
# OpenCV HAAR
faceCascade = cv2.CascadeClassifier('D:\\FaceDetectionComparison\\haarcascade_frontalface_default.xml')
#OpenCV DNN supports 2 networks.
# 1. FP16 version of the origina... |
#!/usr/bin/env python3
import acefile
import argparse
import binascii
import struct
import os
class Color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
... |
import re
import time
from typing import List, Tuple, Iterable, Optional
from mitmproxy.net.http import request, response, headers, url
def get_header_tokens(headers, key):
"""
Retrieve all tokens for a header key. A number of different headers
follow a pattern where each header line can containe... |
import pandas as pd
import numpy as np
import tabula
import os
import pathlib
import uuid
import warnings
warnings.filterwarnings("ignore")
def main():
arquivos_darf = listar_arquivos_darf()
darf_escolhida = arquivos_darf[0]
imposto_a_pagar = calcular_imposto_a_pagar_darf(darf_escolhida)
print... |
#########
# Copyright (c) 2013 GigaSpaces Technologies Ltd. All rights reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless... |
"""video_frame module
classes:
VideoFrm: a frame where a video is played
MyVideoCapture: class capturing a video source
"""
import tkinter as tk
import cv2
import PIL.Image
import PIL.ImageTk
import os
import tools
class VideoFrm(tk.Frame):
"""A frame with a canvas widget for playing a video.
A Vi... |
import re
import time
import logging
from functools import wraps
import networkx as nx
import matplotlib.pyplot as plt
pyqlog = logging.Logger()
Qubit = None
def statistics_time(func):
@wraps(func)
def inner(*args, **kwargs):
start = time.time()
data = args[0]
if isinstance(data, di... |
import aiohttp
import hashlib
import packaging.requirements
import packaging.tags
import packaging.utils
import packaging.version
import pathlib
import sys
from hat import util
Environment = util.namedtuple('Environment',
['pypi_url', 'str'],
['python_versi... |
#!/usr/bin/env python3
'''
Einfacher Generator für statische Websites
- Seiten in Markdown-Dateien mit Frontmatter
- Vorlagen im Mustache-Format
- Bilder werden in verschiedene Größen verkleinert
'''
import chevron
import frontmatter
import functools
import http.server
import markdown
import os
from PIL import Image... |
# Open3D: www.open3d.org
# The MIT License (MIT)
# See license file or visit www.open3d.org for details
import numpy as np
import argparse
import math
import sys
sys.path.append("../Utility")
from open3d import *
from common import *
from opencv import *
from optimize_posegraph import *
def register_one_rgbd_pair(s,... |
#!/usr/bin/env python
import os
from lxml import etree
import datetime
import json
from fabric.operations import local
from fabric.api import settings
import shutil
import commands
from copy import deepcopy
from dealer.git import git
import sys
import re
from time import sleep
out_dir = 'acceptance_results'
def get_... |
"""Classify tetris using gate activation function
Implement a equivariant model using gates to fit the tetris dataset
Exact equivariance to :math:`E(3)`
>>> test()
"""
import torch
from torch_geometric.data import Data, DataLoader
from e3nn import o3
from e3nn.nn.models.v2106.gate_points_networks import SimpleNetwor... |
import os
import numpy as np
import scipy.sparse
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.colors as mcolors
try:
import mitsuba
except ImportError as error:
print(error)
print("Could not import the Mitsuba 2 python modules. Make sure to \"source setpath.sh\" before running this s... |
# Copyright (c) 2016 NTT DATA
# 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 ... |
import charms.apt
from charms.layer import status
from charms.reactive import when
from charms.reactive import when_not
from charms.reactive import set_state
from charms.reactive import remove_state
from charms.reactive import hook
from charms.reactive.helpers import data_changed
from charms.templating.jinja2 import re... |
import sqlite3
from flask import Flask, flash, jsonify, redirect, render_template, request, session
from flask_session import Session
from tempfile import mkdtemp
from werkzeug.exceptions import default_exceptions, HTTPException, InternalServerError
from werkzeug.security import check_password_hash, generate_password_h... |
import socket
import threading
from tkinter import *
from tkinter import font
from tkinter import ttk
from tkinter import filedialog
import FileClient
import webbrowser
class GUI:
def receive(self):
while True:
try:
message = client.recv(1024).decode(FORMAT)
... |
#!/usr/bin/env
# -*- coding: utf-8 -*-
"""
Copyright 2017-2018 <NAME>
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 l... |
from django.shortcuts import render
from django.http import HttpResponse
from django.http import JsonResponse
import os
from dna import settings
import sys
import libhttp
import libdna
CHR_SORT_DICT = {'chr1':1,
'chr2':2,
'chr3':3,
'chr4':4,
'chr5... |
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
from gpu_tests import pixel_test_pages
from gpu_tests import skia_gold_integration_test_base
from telemetry.util import image_util
from tele... |
# Handle data ingest and configuration file ingest
# NOTE: Inspiration for the ingest of this dataset comes from original
# creators of this dataset. The paper that introduces this dataset
# can be found at https://arxiv.org/abs/1904.03670
import os
import pandas as pd
from collections import Counter
impo... |
from collections import defaultdict
from concurrent.futures import ProcessPoolExecutor, as_completed
import cv2
from tqdm import tqdm
import numpy as np
def parallel_map(array, worker, const_args=None, n_jobs=16, use_kwargs=False, front_num=3, drop_none=False):
"""
A parallel version of the map function ... |
#
# This file is part of pretix (Community Edition).
#
# Copyright (C) 2014-2020 <NAME> and contributors
# Copyright (C) 2020-2021 rami.io GmbH and contributors
#
# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General
# Public License as published by the Free... |
#!/home/danaukes/anaconda3/bin/python
# -*- coding: utf-8 -*-
"""
Created on Mon Apr 22 20:18:03 2019
@author: danaukes
"""
import os
import git_manage.git_tools as git_tools
import argparse
import yaml
import sys
def clean_path(path_in):
path_out = os.path.normpath(os.path.abspath(os.path.expanduser(path_in)))
... |
import abc
import collections
import copy
import typing
import numpy as np
import pandas as pd
import six
import torch
import torch.nn as nn
import torch.optim as optim
from sklearn.utils.multiclass import type_of_target
from torch.utils.data.dataloader import DataLoader, default_collate
from tklearn.neural_network.c... |
from ctypes import *
from mirage.libs.common.sdr.hackrf_definitions import *
from mirage.libs.common.sdr.pipeline import *
from mirage.libs.common.sdr.hardware import *
from mirage.libs import io,utils
import os,threading,numpy
'''
This component implements the supported Software Defined Radio Sources (e.g. RX).
'''
... |
# <NAME>
# Pygame Chess Project
# ChessServer.py
import argparse
import os
import pickle
import socket
import threading
import numpy as np
from ChessBoard import ChessBoard
def parseArgs():
parser = argparse.ArgumentParser(description="Starts a chess server")
parser.add_argument('--host', default='127.0.0.... |
# Copyright 2016 The Johns Hopkins University Applied Physics Laboratory
#
# 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 ... |
import unittest
from unittest.mock import MagicMock
from samsung_multiroom.service import REPEAT_ALL
from samsung_multiroom.service import REPEAT_OFF
from samsung_multiroom.service.tunein import TuneInPlayer
def _get_player():
api = MagicMock()
api.get_preset_list.return_value = [
{
'kind... |
"""
1027. Longest Arithmetic Subsequence
Medium
Given an array nums of integers, return the length of the longest arithmetic subsequence in nums.
Recall that a subsequence of an array nums is a list nums[i1], nums[i2], ..., nums[ik] with 0 <= i1 < i2 < ... < ik <= nums.length - 1, and that a sequence seq is arithmet... |
"""Collect pop music dataset."""
import argparse
import logging
import operator
import random
from pathlib import Path
import joblib
import muspy
import tqdm
from arranger.utils import load_config, setup_loggers
# Load configuration
CONFIG = load_config()
def parse_arguments():
"""Parse command-line arguments.... |
"""
There are ~3000 unique headings in the raw code.
There are only about 40 semantically distinct headings.
This script normalizes all the headings to one of those
~40 headings.
"""
from pprint import pprint
def normalize_headings (dom):
print(' normalizing headings...')
heading_nodes = dom.xpath('//annoGr... |
import datetime
import logging
from enum import Enum
from .config import get_config
from .status import Status, StatusCode
log = logging.getLogger(__name__)
class WeatherRequest:
"""
Class holding all the information that parse_intent_message found
has many functions to return the information in
hu... |
from pyglet.gl import *
class DrawEnv(object):
'''Sets up drawing environment.
My have either or both of a "before" and "after" method.
'''
pass
class DrawBlended(DrawEnv):
'''Sets up texture env for an alpha-blended draw.
'''
def before(self):
glPushAttrib(GL_ENABLE_BIT | GL_CO... |
import logging
import boto3
import types
from pymacaron_core.swagger.apipool import ApiPool
from pymacaron.config import get_config
from pymacaron.exceptions import PyMacaronException
from pymacaron.monitor import monitor
log = logging.getLogger(__name__)
db = None
def get_dynamodb():
global db
if not db:... |
import argparse
import re
import os
import pickle
import numpy as np
from tqdm import tqdm
from rdkit import Chem
from collections import Counter
import torch
import random
from typing import Optional
def seed_everything(seed: Optional[int] = 0) -> None:
torch.manual_seed(seed)
random.seed(seed)
os.enviro... |
import os
from pathlib import Path
from datetime import datetime, date
import pytest
import numpy as np
from odinapi.views.newdonalettyERANC import (
run_donaletty, Donaletty)
from odinapi.views.msis90 import Msis90
@pytest.fixture
def inputdatapath():
p = Path(__file__)
for p in p.parents:
if p.... |
from neo4j import GraphDatabase
import random
uri = "bolt://localhost:7687"
driver = GraphDatabase.driver(uri, auth=("neo4j", "ciao"))
PERIODS = ['morning', 'afternoon', 'evening', 'night']
KINDS = ['high-tech', 'food', 'clothing', 'consumable', 'other']
def q1(limit = 10):
query_1 = ( "MATCH (c:Customer)-[t:TR... |
import requests
import pandas
import csv
from io import StringIO
import time
import datetime
import email_sendgrid
import email_smtp
# Yahoo finance API
YAHOO_FINANCE_API = "http://finance.yahoo.com/d/quotes.csv"
YAHOO_FINANCE_SYMBOL_PARAM = "s"
YAHOO_FINANCE_FORMAT_PARAM = "f"
YAHOO_FINANCE_52_WEEK_HIGH = ... |
import torch
import torch.nn as nn
from torch.nn.utils.rnn import pad_packed_sequence, pack_padded_sequence
class Encoder(nn.Module):
def __init__(self, embedding_layer, hidden_size, num_layers,
bidirectional, dropout, latent_size):
super(Encoder, self).__init__()
self.embedding... |
import sys
import glob
import numpy as np
import ROOT
from HLTIO import preprocess
from sklearn.datasets import dump_svmlight_file
from sklearn.datasets import load_svmlight_file
from scipy import sparse
from pathlib import Path
import math
import pandas as pd
# IO (Require ROOT version > 6.14)
def dR(eta1, phi1, eta2... |
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
# Copyright (c) 2013 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, ... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 0.5.0.5149 (http://hl7.org/fhir/StructureDefinition/Medication) on 2015-07-06.
# 2015, SMART Health IT.
from . import codeableconcept
from . import domainresource
from . import fhirdate
from . import fhirelement
from . import fhirreference
from .... |
import os
from pytest import raises
from PIL import Image, ImageChops
from matplotlib import pyplot as plt
from matplotlib.testing.compare import compare_images
from discopy import *
IMG_FOLDER, TIKZ_FOLDER, TOL = 'test/imgs/', 'test/tikz/', 10
def draw_and_compare(file, folder=IMG_FOLDER, tol=TOL,
... |
import numpy as np
import numba
from scipy.special import logsumexp
import strax
import straxen
class BayesPeakClassification(strax.Plugin):
"""
Bayes Peak classification
Returns the ln probability of a each event belonging to the S1 and S2 class.
Uses conditional probabilities and data parameterizati... |
"""
Handles retrieval of news data and articles
"""
import doctest
import json
import webbrowser
import requests
import default_country
# DEMONSTRATES DECORATORS
def print_messages(original_func):
"""
Print loading messages to display for user.
:param original_func: A function
:precondition: original... |
import numpy as np
import subprocess
import numba as nb
import os
import pymech.neksuite as nek
def write_hist_points(n_hist):
with open("square.his", "w") as file:
file.write(str(n_hist) + '\n')
# Top
for j in range(int((n_hist-9)/4)):
dx = j / int((n_hist-9)/4)
... |
"""Families views."""
# Django Rest Framework
from rest_framework import status, viewsets, mixins
from rest_framework.exceptions import ValidationError
from rest_framework.decorators import action
from rest_framework.generics import get_object_or_404
from rest_framework.response import Response
# Permissions
from res... |
import os
import torch
import logging
import argparse
from contextlib import redirect_stdout
from src.base.default_cfg import get_cfg_defaults
from src.base.common import create_dir_maybe, setup_seed
from src.datasets import get_dataloader
from torch.nn.utils.rnn import pad_sequence
from kg_practice.L4.data import l... |
# References
# Pre-trained weights:
# https://github.com/facebookresearch/WSL-Images
# Borrowed a lot from abhishek, so give him an upvote:
# https://www.kaggle.com/abhishek/very-simple-pytorch-training-0-59
# https://www.kaggle.com/abhishek/pytorch-inference-kernel-lazy-tta
# Parameters
lr = 1e-5
img_size = 224
b... |
import json
import re
from typing import Any, Dict, List, Optional, Union
from pydantic import BaseModel
from ikea_api import Constants
from ikea_api.wrappers import types
from ikea_api.wrappers._parsers.item_base import (
ItemCode,
ItemType,
get_is_combination_from_item_type,
)
__all__ = ["main"]
clas... |
#!/usr/bin/env python
'''
Created on 22 Aug 2020
This is a script to compute the cardinalities of the 1- and 2-layer past
infinities for sprinkles in an Alexandrov subset of 1 + 1 Minkowski space.
The values are determined in two ways: simulated and analytic.
@author: <NAME>
'''
from __future__ import anno... |
from sklearn.preprocessing import Normalizer
from PIL import Image
import numpy as np
import joblib
from sklearn.neighbors import KNeighborsClassifier
from sklearn.preprocessing import LabelEncoder
import os
import csv
# import pandas as pd
KNN_CLASSIFIER_DICT = {"trained": False, "classifier": None}
def load_datase... |
print("This is a game for Robinson Crusoe Day. \nWritten by AW '23")
print("\nPress Run to start.")
name = input("Enter your nickname: ")
#function that is called when player dies
def death_message():
print("You didn't pick the right choice and now you're dead 😔✋")
#introductory message and first question
def fi... |
import socket, threading, datetime, time, sqlite3, pickle
def receive_data(self): #Recevoir les données des clients
try:
data = self.csocket.recv(2048)
return pickle.loads(data)
except:
print(get_time() + " - Client depuis " + str(clientAddress) + " c'est déconnecté")
... |
# from generate_path import G_pro
import threading
import osmnx as ox
from matplotlib import animation
import matplotlib.pyplot as plt
import numpy as np
from flask import Flask, request, jsonify, render_template, redirect, url_for
import pickle
import joblib
import time
import os
# import generate_copy
import runpy
im... |
import logging
from tablib import Dataset
from contracts import contract
from django.http import HttpRequest
from django.shortcuts import render
from django.utils.translation import gettext as _
from django.views.generic.edit import FormView
from import_export.results import Result
from lib_import.exceptions import ... |
#!/usr/bin/env python3
import os
import json
import shutil
from typing import Dict
from dataclasses import dataclass
DOCS_DIR = "docs/"
MAIN_PAGE_MD_TEMPLATE = """
# Standard Library Reference
The Standard Library is a collection of functions, packs and definitions that are available to all QINP programs and are e... |
from typing import Any, Callable, Optional
import torch
import torch.nn.functional as F
from torch.utils.data import DataLoader
from tqdm import tqdm
def train(dataset: torch.utils.data.Dataset,
autoencoder: torch.nn.Module,
epochs: int,
batch_size: int,
optimizer: torch.optim.... |
from typing import Dict, Any, Optional, Union, Sequence, Type, Tuple
import click
def new_cli_ctx_obj():
return {
"traceback": False,
"scheduler": None,
}
def cli_option_traceback(func):
"""Decorator for adding a pre-defined, reusable CLI option `--traceback`."""
# noinspection PyU... |
import collections
import copy
import filecmp
import os
import shutil
import sys
import pytest
import munge
from munge import config
test_dir = os.path.relpath(os.path.dirname(__file__))
data_dir = os.path.join(test_dir, "data")
conf0_dir = os.path.join(data_dir, "conf0")
extra_schemes = {"tyam": {"type": "toml", "c... |
#! /usr/bin/env python3
#
# Author: <NAME>
# Email : <EMAIL>
# Date : 2019.03.19
#
import argparse
import json
import os
import subprocess
import urllib3
from collections import namedtuple
from pick import pick
from selenium import webdriver
from urllib.parse import urljoin
parser = argparse.ArgumentParser()
parser... |
import numpy as np
import torch
from sklearn.utils import check_random_state
from model.core import floath, cost_var, find_sigma, calc_original_simul_prob, calc_visible_simul_prob, calc_square_euclidean_norms
def find_visible_data(original_data, visible_data, sigma, N, output_dims, n_epochs,
in... |
# coding=utf-8
# Copyright 2020 The Google Research 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 applicab... |
import math
from rlbot.agents.base_agent import BaseAgent, SimpleControllerState
from rlbot.utils.structures.game_data_struct import GameTickPacket
from src.util.orientation import Orientation
from src.util.vec import Vec3
from src.util.debug import draw_debug
from src.util.angle import find_correction
from src.strat... |
# ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 3
# of the License, or (at your option) any later version.
#
# This program is distrib... |
import jinja2
import os
import json
import datetime
import collections
import re
from mod_pbxproj import XcodeProject
scriptDir = os.path.dirname(os.path.realpath(__file__))
with open(os.path.join("Components", "components.json")) as f:
components = json.loads(f.read())
with open(os.path.join("Components", "Sett... |
import os, time, re, sys, requests
sys.path.append('lib/')
from slackclient import SlackClient
from leafly import Leafly
# instantiate Slack client
slack_client = SlackClient(os.environ.get('SLACK_BOT_TOKEN'))
# starterbot's user ID in Slack: value is assigned after the bot starts up
starterbot_id = None
# constants
... |
from __future__ import print_function
from urllib2 import build_opener, HTTPHandler, Request
from botocore.exceptions import ClientError
import boto3
import json
import httplib
import os
def handler(event, context):
print("log -- Event: %s " % json.dumps(event))
codecommit = boto3.client('codecommit')
#sec... |
# -*- coding: utf-8 -*-
# Copyright 2013-2015 <NAME>
#
# 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... |
"""
TODO: Give this script a list of playlists and have it make a directory of raw
and test data. Don't do any preprocessing on the data - you can
have the octopod system do that.
When run as a script, this will mount the given hard drive at data/raw/
and then download all the data into it and create a test split.
"""... |
import pickle
import argparse
import pandas as pd
import numpy as np
def get_importations(tree_idx, tree, translate_dict, focal_region):
parse_loc = lambda k: k.comment.split('=')[1].replace('"', '')
# get all tips from focal region
focal_tips = [i for i in tree.get_terminals() if
parse_loc(i) == focal_region]
... |
from act_overseer.act_to_neo4j import filename
import act_overseer.decide_to_act
import json
import logging
import requests
import unittest
# After decide_to_act receives json from dashboard, it's job is to remove from all hosts important host for
# given missions and their configurations. Then remove hosts with tre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.